From 19e683e62a732b7a927b1921b68d0d20212bcccc Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 28 Mar 2013 17:38:44 +0100 Subject: [PATCH] broadway: Clean up moveresize code --- gdk/broadway/gdkdisplay-broadway.h | 2 ++ gdk/broadway/gdkwindow-broadway.c | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h index 0b8c83ada1..b249e806e8 100644 --- a/gdk/broadway/gdkdisplay-broadway.h +++ b/gdk/broadway/gdkdisplay-broadway.h @@ -66,6 +66,8 @@ struct _GdkBroadwayDisplay GdkWindow *active_offscreen_window; GdkBroadwayServer *server; + + gpointer move_resize_data; }; struct _GdkBroadwayDisplayClass diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c index df3e965eb4..e9f2b06f1e 100644 --- a/gdk/broadway/gdkwindow-broadway.c +++ b/gdk/broadway/gdkwindow-broadway.c @@ -999,20 +999,19 @@ static MoveResizeData * get_move_resize_data (GdkDisplay *display, gboolean create) { + GdkBroadwayDisplay *broadway_display; MoveResizeData *mv_resize; - static GQuark move_resize_quark = 0; - if (!move_resize_quark) - move_resize_quark = g_quark_from_static_string ("gdk-window-moveresize"); + broadway_display = GDK_BROADWAY_DISPLAY (display); - mv_resize = g_object_get_qdata (G_OBJECT (display), move_resize_quark); + mv_resize = broadway_display->move_resize_data; if (!mv_resize && create) { mv_resize = g_new0 (MoveResizeData, 1); mv_resize->display = display; - g_object_set_qdata (G_OBJECT (display), move_resize_quark, mv_resize); + broadway_display->move_resize_data = mv_resize; } return mv_resize; @@ -1135,7 +1134,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display, switch (event->base.type) { - case 'm': + case BROADWAY_EVENT_POINTER_MOVE: if (mv_resize->moveresize_window->resize_count > 0) { if (mv_resize->moveresize_pending_event) @@ -1163,7 +1162,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display, finish_drag (mv_resize); break; - case 'B': + case BROADWAY_EVENT_BUTTON_RELEASE: update_pos (mv_resize, event->pointer.root_x, event->pointer.root_y);