projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
get rid of wxClientDC::m_oldFont, it wasn't really used (this fixes crash introduced...
[wxWidgets.git]
/
src
/
unix
/
utilsx11.cpp
diff --git
a/src/unix/utilsx11.cpp
b/src/unix/utilsx11.cpp
index 4f16da9388bb79acfbc74caba2dc335cef272c1a..6510b0d3dba9ac182475a21b5b8ccd222c5b97ce 100644
(file)
--- a/
src/unix/utilsx11.cpp
+++ b/
src/unix/utilsx11.cpp
@@
-5,7
+5,7
@@
// Modified by:
// Created: 25.03.02
// RCS-ID: $Id$
// Modified by:
// Created: 25.03.02
// RCS-ID: $Id$
-// Copyright: (c) wxWi
ndow
s team
+// Copyright: (c) wxWi
dget
s team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@
-29,7
+29,7
@@
#pragma message enable nosimpint
#endif
#pragma message enable nosimpint
#endif
-#ifdef __WXGTK
20
__
+#ifdef __WXGTK__
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#endif
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#endif
@@
-65,12
+65,19
@@
static bool IsMapped(Display *display, Window window)
// Suspends X11 errors. Used when we expect errors but they are not fatal
// for us.
// Suspends X11 errors. Used when we expect errors but they are not fatal
// for us.
+extern "C"
+{
+ typedef int (*wxX11ErrorHandler)(Display *, XErrorEvent *);
+
+ static int wxX11ErrorsSuspender_handler(Display*, XErrorEvent*) { return 0; }
+}
+
class wxX11ErrorsSuspender
{
public:
wxX11ErrorsSuspender(Display *d) : m_display(d)
{
class wxX11ErrorsSuspender
{
public:
wxX11ErrorsSuspender(Display *d) : m_display(d)
{
- m_old = XSetErrorHandler(handler);
+ m_old = XSetErrorHandler(
wxX11ErrorsSuspender_
handler);
}
~wxX11ErrorsSuspender()
{
}
~wxX11ErrorsSuspender()
{
@@
-80,8
+87,7
@@
public:
private:
Display *m_display;
private:
Display *m_display;
- int (*m_old)(Display*, XErrorEvent *);
- static int handler(Display *, XErrorEvent *) { return 0; }
+ wxX11ErrorHandler m_old;
};
};
@@
-196,10
+202,10
@@
void wxSetIconsX11( WXDisplay* display, WXWindow window,
// implements, KDE will support it from version 3.2. At toolkits level,
// GTK+ >= 2.1.2 uses it as the only method of making windows fullscreen
// (that's why wxGTK will *not* switch to using gtk_window_fullscreen
// implements, KDE will support it from version 3.2. At toolkits level,
// GTK+ >= 2.1.2 uses it as the only method of making windows fullscreen
// (that's why wxGTK will *not* switch to using gtk_window_fullscreen
-// unless it has better compatiblity with older WMs).
+// unless it has better compatib
i
lity with older WMs).
//
//
//
//
-// This is what wxWi
ndow
s does in wxSetFullScreenStateX11:
+// This is what wxWi
dget
s does in wxSetFullScreenStateX11:
// 1) if _NET_WM_STATE_FULLSCREEN is supported, use it
// 2) otherwise try WM-specific hacks (KDE, IceWM)
// 3) use _WIN_LAYER and hope that the WM will recognize it
// 1) if _NET_WM_STATE_FULLSCREEN is supported, use it
// 2) otherwise try WM-specific hacks (KDE, IceWM)
// 3) use _WIN_LAYER and hope that the WM will recognize it
@@
-406,7
+412,7
@@
static void wxSetKDEFullscreen(Display *display, Window rootWnd,
lng = 1;
}
lng = 1;
}
- // it is nec
c
essary to unmap the window, otherwise kwin will ignore us:
+ // it is necessary to unmap the window, otherwise kwin will ignore us:
XSync(display, False);
bool wasMapped = IsMapped(display, w);
XSync(display, False);
bool wasMapped = IsMapped(display, w);
@@
-433,12
+439,12
@@
static void wxSetKDEFullscreen(Display *display, Window rootWnd,
if (!fullscreen)
{
if (!fullscreen)
{
- // NB: like many other WMs, kwin ignores
first request for
window
+ // NB: like many other WMs, kwin ignores
the first request for a
window
// position change after the window was mapped. This additional
// move+resize event will ensure that the window is restored in
// position change after the window was mapped. This additional
// move+resize event will ensure that the window is restored in
- // exactly same position as before it was made fullscreen (because
-
//
wxTopLevelWindow::ShowFullScreen will call SetSize, thus
- // setting the position for second time).
+ // exactly the same position as before it was made fullscreen
+
// (because
wxTopLevelWindow::ShowFullScreen will call SetSize, thus
+ // setting the position for
the
second time).
XMoveResizeWindow(display, w,
origRect->x, origRect->y,
origRect->width, origRect->height);
XMoveResizeWindow(display, w,
origRect->x, origRect->y,
origRect->width, origRect->height);
@@
-764,10
+770,15
@@
KeySym wxCharCodeWXToX(int id)
bool wxGetKeyState(wxKeyCode key)
{
bool wxGetKeyState(wxKeyCode key)
{
+ wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+ WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
#if defined(__WXX11__)
#if defined(__WXX11__)
- Display *pDisplay = wxApp::GetDisplay();
+ Display *pDisplay =
(Display*)
wxApp::GetDisplay();
#elif defined(__WXGTK__)
Display *pDisplay = GDK_DISPLAY();
#elif defined(__WXGTK__)
Display *pDisplay = GDK_DISPLAY();
+#elif defined(__WXMOTIF__)
+ Display *pDisplay = (Display*) (wxTheApp ? wxTheApp->GetInitialDisplay() : NULL);
#else
#error Add code to get the DISPLAY for this platform
#endif
#else
#error Add code to get the DISPLAY for this platform
#endif