- gdk_pointer_grab( widget->window, FALSE,
- (GdkEventMask)
- (GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_MOTION_MASK |
- GDK_BUTTON1_MOTION_MASK),
- (GdkWindow *) NULL,
- (GdkCursor *) NULL,
- GDK_CURRENT_TIME );
-
- win->m_diffX = (int)gdk_event->x;
- win->m_diffY = (int)gdk_event->y;
- DrawFrame( widget, 0, 0, win->m_width, win->m_height );
+ int style = win->GetWindowStyle();
+
+ int y = (int)gdk_event->y;
+ int x = (int)gdk_event->x;
+
+ if ((style & wxRESIZE_BORDER) &&
+ (x > win->m_width-14) && (y > win->m_height-14))
+ {
+ GtkWidget *ancestor = gtk_widget_get_toplevel( widget );
+
+ GdkWindow *source = gtk_widget_get_window(widget);
+
+ int org_x = 0;
+ int org_y = 0;
+ gdk_window_get_origin( source, &org_x, &org_y );
+
+ gtk_window_begin_resize_drag (GTK_WINDOW (ancestor),
+ GDK_WINDOW_EDGE_SOUTH_EAST,
+ 1,
+ org_x + x,
+ org_y + y,
+ 0);
+
+ return TRUE;
+ }
+
+ if (win->m_miniTitle && (style & wxCLOSE_BOX))
+ {
+ if ((y > 3) && (y < 19) && (x > win->m_width-19) && (x < win->m_width-3))
+ {
+ win->Close();
+ return TRUE;
+ }
+ }
+
+ if (y >= win->m_miniEdge + win->m_miniTitle)
+ return true;
+
+ gdk_window_raise(gtk_widget_get_window(win->m_widget));
+
+ const GdkEventMask mask = GdkEventMask(
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_MASK |
+ GDK_POINTER_MOTION_HINT_MASK |
+ GDK_BUTTON_MOTION_MASK |
+ GDK_BUTTON1_MOTION_MASK);
+#ifdef __WXGTK3__
+ gdk_device_grab(
+ gdk_event->device, gdk_event->window, GDK_OWNERSHIP_NONE,
+ false, mask, NULL, gdk_event->time);
+#else
+ gdk_pointer_grab(gdk_event->window, false, mask, NULL, NULL, gdk_event->time);
+#endif
+
+ win->m_diffX = x;
+ win->m_diffY = y;