#include "wx/gtk/private/event.h"
using namespace wxGTKImpl;
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#else
+typedef guint KeySym;
+#endif
#include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION(3,0,0)
keysym = (KeySym)gdk_event->string[0];
}
+#ifdef GDK_WINDOWING_X11
// we want to always get the same key code when the same key is
// pressed regardless of the state of the modifiers, i.e. on a
// standard US keyboard pressing '5' or '%' ('5' key with
// use the normalized, i.e. lower register, keysym if we've
// got one
key_code = keysymNormalized ? keysymNormalized : keysym;
+#else
+ key_code = keysym;
+#endif
// as explained above, we want to have lower register key codes
// normally but for the letter keys we want to have the upper ones
else
{
if ((child->m_wxwindow == NULL) &&
- !gtk_widget_get_has_window(child->m_widget) &&
win->IsClientAreaChild(child) &&
(child->m_x <= xx) &&
(child->m_y <= yy) &&
m_width = WidthDefault(size.x) ;
m_height = HeightDefault(size.y);
- m_x = (int)pos.x;
- m_y = (int)pos.y;
+ if (pos != wxDefaultPosition)
+ {
+ m_x = pos.x;
+ m_y = pos.y;
+ }
return true;
}
void wxWindowGTK::DoGetSize( int *width, int *height ) const
{
- wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
-
if (width) (*width) = m_width;
if (height) (*height) = m_height;
}
void wxWindowGTK::DoGetPosition( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
-
int dx = 0;
int dy = 0;
- if (!IsTopLevel() && m_parent && m_parent->m_wxwindow)
+ GtkWidget* parent = NULL;
+ if (m_widget)
+ parent = gtk_widget_get_parent(m_widget);
+ if (WX_IS_PIZZA(parent))
{
- wxPizza* pizza = WX_PIZZA(m_parent->m_wxwindow);
+ wxPizza* pizza = WX_PIZZA(parent);
dx = pizza->m_scroll_x;
dy = pizza->m_scroll_y;
}
-
- if (m_x == -1 && m_y == -1)
- {
- GdkWindow *source = NULL;
- if (m_wxwindow)
- source = gtk_widget_get_window(m_wxwindow);
- else
- source = gtk_widget_get_window(m_widget);
-
- if (source)
- {
- int org_x = 0;
- int org_y = 0;
- gdk_window_get_origin( source, &org_x, &org_y );
-
- if (m_parent)
- m_parent->ScreenToClient(&org_x, &org_y);
-
- const_cast<wxWindowGTK*>(this)->m_x = org_x;
- const_cast<wxWindowGTK*>(this)->m_y = org_y;
- }
- }
-
if (x) (*x) = m_x - dx;
if (y) (*y) = m_y - dy;
}
GdkDeviceManager* manager = gdk_display_get_device_manager(display);
gdk_device_warp(gdk_device_manager_get_client_pointer(manager), screen, x, y);
#else
+#ifdef GDK_WINDOWING_X11
XWarpPointer(GDK_DISPLAY_XDISPLAY(display),
None,
GDK_WINDOW_XID(gdk_screen_get_root_window(screen)),
0, 0, 0, 0, x, y);
#endif
+#endif
}
wxWindowGTK::ScrollDir wxWindowGTK::ScrollDirFromRange(GtkRange *range) const
{
// Make sure GDK/X11 doesn't refresh the window
// automatically.
- gdk_window_set_back_pixmap( window, None, False );
+ gdk_window_set_back_pixmap( window, NULL, FALSE );
m_needsStyleChange = false;
}
else // window not realized yet