// Author: Julian Smart
// Modified by:
// Created: 17/09/98
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
}
#endif
- if (wxWindowIsVisible(xwindow))
+ XWindowAttributes wa;
+ XGetWindowAttributes(wxGlobalDisplay(), xwindow, &wa);
+
+ if (wa.map_state == IsViewable)
{
wxLogTrace( wxT("focus"), wxT("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName());
// XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
wxCHECK_MSG( xwindow, false, wxT("invalid window") );
wxCursor cursorToUse;
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
cursorToUse = m_cursor;
else
cursorToUse = *wxSTANDARD_CURSOR;
int wxWindowX11::GetCharHeight() const
{
wxFont font(GetFont());
- wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") );
+ wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") );
#if wxUSE_UNICODE
// There should be an easier way.
int wxWindowX11::GetCharWidth() const
{
wxFont font(GetFont());
- wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") );
+ wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") );
#if wxUSE_UNICODE
// There should be an easier way.
wxFont fontToUse = GetFont();
if (theFont) fontToUse = *theFont;
- wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
+ wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") );
if (string.empty())
{
PangoFontDescription *desc = fontToUse.GetNativeFontInfo()->description;
pango_layout_set_font_description(layout, desc);
- const wxCharBuffer data = wxConvUTF8.cWC2MB( string );
+ const wxCharBuffer data = wxConvUTF8.cWC2MB( string.wc_str() );
pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
PangoLayoutLine *line = (PangoLayoutLine *)pango_layout_get_lines(layout)->data;
// Update invalidated regions.
Update();
- // This calls the UI-update mechanism (querying windows for
- // menu/toolbar/control state information)
- if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShownOnScreen())
- UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
+ wxWindowBase::OnInternalIdle();
// Set the input focus if couldn't do it before
if (m_needsInputFocus)
button = xevent->xbutton.button;
wxevent.m_linesPerAction = 3;
+ wxevent.m_columnsPerAction = 3;
wxevent.m_wheelDelta = WHEEL_DELTA;
// Button 4 means mousewheel up, 5 means down
bool wxWinModule::OnInit()
{
Display *xdisplay = wxGlobalDisplay();
+ if ( !xdisplay )
+ {
+ // This module may be linked into a console program when using
+ // monolithic library and in this case it's perfectly normal not to
+ // have a display, so just return without doing anything and avoid
+ // crashing below.
+ return true;
+ }
+
int xscreen = DefaultScreen( xdisplay );
Window xroot = RootWindow( xdisplay, xscreen );
g_eraseGC = XCreateGC( xdisplay, xroot, 0, NULL );