[mutter] Remove usage of 'gdk_display', a removed symbol in gtk3.



commit 0d51d9e4cf1c175f921728ae419cefa7044c1b46
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Sep 10 07:17:55 2010 +0000

    Remove usage of 'gdk_display', a removed symbol in gtk3.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629232

 src/core/main.c            |    2 +-
 src/tools/mutter-message.c |   43 ++++++-----
 src/ui/frames.c            |  181 ++++++++++++++++++++++++-------------------
 src/ui/menu.c              |    6 +-
 src/ui/tabpopup.c          |    6 +-
 src/ui/ui.c                |    7 +-
 6 files changed, 137 insertions(+), 108 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 8eae74f..b3a673e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -401,7 +401,7 @@ static GSourceFuncs event_funcs = {
 static void
 meta_clutter_init (GOptionContext *ctx, int *argc, char ***argv)
 {
-  clutter_x11_set_display (gdk_display);
+  clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
   clutter_x11_disable_event_retrieval ();
   
   if (CLUTTER_INIT_SUCCESS == clutter_init (argc, argv))
diff --git a/src/tools/mutter-message.c b/src/tools/mutter-message.c
index 22977e7..4aed444 100644
--- a/src/tools/mutter-message.c
+++ b/src/tools/mutter-message.c
@@ -29,6 +29,7 @@
 #define _(x) dgettext (GETTEXT_PACKAGE, x)
 #define N_(x) x
 
+static Display *display;
 
 static void
 send_restart (void)
@@ -38,9 +39,9 @@ send_restart (void)
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = gdk_x11_get_default_root_xwindow ();
-  xev.xclient.message_type = XInternAtom (gdk_display,
+  xev.xclient.message_type = XInternAtom (display,
                                           "_MUTTER_RESTART_MESSAGE",
                                           False);
   xev.xclient.format = 32;
@@ -48,14 +49,14 @@ send_restart (void)
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
 
-  XSendEvent (gdk_display,
+  XSendEvent (display,
               gdk_x11_get_default_root_xwindow (),
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
 
-  XFlush (gdk_display);
-  XSync (gdk_display, False);
+  XFlush (display);
+  XSync (display, False);
 }
 
 static void
@@ -66,9 +67,9 @@ send_reload_theme (void)
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = gdk_x11_get_default_root_xwindow ();
-  xev.xclient.message_type = XInternAtom (gdk_display,
+  xev.xclient.message_type = XInternAtom (display,
                                           "_MUTTER_RELOAD_THEME_MESSAGE",
                                           False);
   xev.xclient.format = 32;
@@ -76,14 +77,14 @@ send_reload_theme (void)
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
 
-  XSendEvent (gdk_display,
+  XSendEvent (display,
               gdk_x11_get_default_root_xwindow (),
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
 
-  XFlush (gdk_display);
-  XSync (gdk_display, False);
+  XFlush (display);
+  XSync (display, False);
 }
 
 static void
@@ -94,9 +95,9 @@ send_set_keybindings (gboolean enabled)
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = gdk_x11_get_default_root_xwindow ();
-  xev.xclient.message_type = XInternAtom (gdk_display,
+  xev.xclient.message_type = XInternAtom (display,
                                           "_MUTTER_SET_KEYBINDINGS_MESSAGE",
                                           False);
   xev.xclient.format = 32;
@@ -104,14 +105,14 @@ send_set_keybindings (gboolean enabled)
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
 
-  XSendEvent (gdk_display,
+  XSendEvent (display,
               gdk_x11_get_default_root_xwindow (),
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
 
-  XFlush (gdk_display);
-  XSync (gdk_display, False);
+  XFlush (display);
+  XSync (display, False);
 }
 
 #ifdef WITH_VERBOSE_MODE
@@ -123,9 +124,9 @@ send_toggle_verbose (void)
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = display;
   xev.xclient.window = gdk_x11_get_default_root_xwindow ();
-  xev.xclient.message_type = XInternAtom (gdk_display,
+  xev.xclient.message_type = XInternAtom (display,
                                           "_MUTTER_TOGGLE_VERBOSE",
                                           False);
   xev.xclient.format = 32;
@@ -133,14 +134,14 @@ send_toggle_verbose (void)
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
 
-  XSendEvent (gdk_display,
+  XSendEvent (display,
               gdk_x11_get_default_root_xwindow (),
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
 	      &xev);
 
-  XFlush (gdk_display);
-  XSync (gdk_display, False);
+  XFlush (display);
+  XSync (display, False);
 }
 #endif
 
@@ -162,6 +163,8 @@ main (int argc, char **argv)
   if (argc < 2)
     usage ();
 
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+
   if (strcmp (argv[1], "restart") == 0)
     send_restart ();
   else if (strcmp (argv[1], "reload-theme") == 0)
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 27928f1..f7654a5 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -361,7 +361,7 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
   meta_frames_set_window_background (frames, frame);
   
   invalidate_whole_window (frames, frame);
-  meta_core_queue_frame_resize (gdk_display,
+  meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                                 frame->xwindow);
   if (frame->layout)
     {
@@ -456,7 +456,7 @@ meta_frames_ensure_layout (MetaFrames  *frames,
 
   g_return_if_fail (gtk_widget_get_realized (widget));
       
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_END);
@@ -539,7 +539,7 @@ meta_frames_calc_geometry (MetaFrames        *frames,
   MetaFrameType type;
   MetaButtonLayout button_layout;
   
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
                  META_CORE_GET_CLIENT_WIDTH, &width,
                  META_CORE_GET_CLIENT_HEIGHT, &height,
                  META_CORE_GET_FRAME_FLAGS, &flags,
@@ -625,7 +625,7 @@ meta_frames_manage_window (MetaFrames *frames,
    * and meta_ui_create_frame_window() return to meta_window_ensure_frame().
    */
   
-  meta_core_grab_buttons (gdk_display, frame->xwindow);
+  meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
   
   g_hash_table_replace (frames->frames, &frame->xwindow, frame);
 }
@@ -648,7 +648,7 @@ meta_frames_unmanage_window (MetaFrames *frames,
       invalidate_all_caches (frames);
       
       /* restore the cursor */
-      meta_core_set_screen_cursor (gdk_display,
+      meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                                    frame->xwindow,
                                    META_CURSOR_DEFAULT);
 
@@ -715,7 +715,7 @@ meta_frames_get_geometry (MetaFrames *frames,
   if (frame == NULL)
     meta_bug ("No such frame 0x%lx\n", xwindow);
   
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_END);
@@ -780,7 +780,7 @@ meta_frames_unflicker_bg (MetaFrames *frames,
   meta_frames_paint_to_drawable (frames, frame, pixmap);
 #endif
 
-  set_background_none (gdk_display, frame->xwindow);
+  set_background_none (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
 }
 
 void
@@ -797,10 +797,13 @@ meta_frames_apply_shapes (MetaFrames *frames,
   XRectangle xrect;
   Region corners_xregion;
   Region window_xregion;
+  Display *display;
   
   frame = meta_frames_lookup_window (frames, xwindow);
   g_return_if_fail (frame != NULL);
 
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+
   meta_frames_calc_geometry (frames, frame, &fgeom);
 
   if (!(fgeom.top_left_corner_rounded_radius != 0 ||
@@ -815,7 +818,7 @@ meta_frames_apply_shapes (MetaFrames *frames,
                       "Unsetting shape mask on frame 0x%lx\n",
                       frame->xwindow);
           
-          XShapeCombineMask (gdk_display, frame->xwindow,
+          XShapeCombineMask (display, frame->xwindow,
                              ShapeBounding, 0, 0, None, ShapeSet);
           frame->shape_applied = FALSE;
         }
@@ -940,8 +943,8 @@ meta_frames_apply_shapes (MetaFrames *frames,
       
       attrs.override_redirect = True;
       
-      shape_window = XCreateWindow (gdk_display,
-                                    RootWindow (gdk_display, screen_number),
+      shape_window = XCreateWindow (display,
+                                    RootWindow (display, screen_number),
                                     -5000, -5000,
                                     new_window_width,
                                     new_window_height,
@@ -953,11 +956,11 @@ meta_frames_apply_shapes (MetaFrames *frames,
                                     &attrs);
 
       /* Copy the client's shape to the temporary shape_window */
-      meta_core_get (gdk_display, frame->xwindow,
+      meta_core_get (display, frame->xwindow,
                      META_CORE_GET_CLIENT_XWINDOW, &client_window,
                      META_CORE_GET_END);
 
-      XShapeCombineShape (gdk_display, shape_window, ShapeBounding,
+      XShapeCombineShape (display, shape_window, ShapeBounding,
                           fgeom.left_width,
                           fgeom.top_height,
                           client_window,
@@ -980,17 +983,17 @@ meta_frames_apply_shapes (MetaFrames *frames,
 
       XDestroyRegion (client_xregion);
       
-      XShapeCombineRegion (gdk_display, shape_window,
+      XShapeCombineRegion (display, shape_window,
                            ShapeBounding, 0, 0, window_xregion, ShapeUnion);
       
       /* Now copy shape_window shape to the real frame */
-      XShapeCombineShape (gdk_display, frame->xwindow, ShapeBounding,
+      XShapeCombineShape (display, frame->xwindow, ShapeBounding,
                           0, 0,
                           shape_window,
                           ShapeBounding,
                           ShapeSet);
 
-      XDestroyWindow (gdk_display, shape_window);
+      XDestroyWindow (display, shape_window);
     }
   else
     {
@@ -1000,7 +1003,7 @@ meta_frames_apply_shapes (MetaFrames *frames,
                   "Frame 0x%lx has shaped corners\n",
                   frame->xwindow);
       
-      XShapeCombineRegion (gdk_display, frame->xwindow,
+      XShapeCombineRegion (display, frame->xwindow,
                            ShapeBounding, 0, 0, window_xregion, ShapeSet);
     }
   
@@ -1089,12 +1092,15 @@ show_tip_now (MetaFrames *frames)
   Window root, child;
   guint mask;
   MetaFrameControl control;
+  Display *display;
   
   frame = frames->last_motion_frame;
   if (frame == NULL)
     return;
 
-  XQueryPointer (gdk_display,
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+
+  XQueryPointer (display,
                  frame->xwindow,
                  &root, &child,
                  &root_x, &root_y,
@@ -1184,7 +1190,7 @@ show_tip_now (MetaFrames *frames)
 
       screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
       
-      meta_fixed_tip_show (gdk_display,
+      meta_fixed_tip_show (display,
                            screen_number,
                            rect->x + dx,
                            rect->y + rect->height + 2 + dy,
@@ -1248,23 +1254,26 @@ meta_frame_titlebar_event (MetaUIFrame    *frame,
                            int            action)
 {
   MetaFrameFlags flags;
+  Display *display;
+
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
   
   switch (action)
     {
     case META_ACTION_TITLEBAR_TOGGLE_SHADE:
       {
-        meta_core_get (gdk_display, frame->xwindow,
+        meta_core_get (display, frame->xwindow,
                        META_CORE_GET_FRAME_FLAGS, &flags,
                        META_CORE_GET_END);
         
         if (flags & META_FRAME_ALLOWS_SHADE)
           {
             if (flags & META_FRAME_SHADED)
-              meta_core_unshade (gdk_display,
+              meta_core_unshade (display,
                                  frame->xwindow,
                                  event->time);
             else
-              meta_core_shade (gdk_display,
+              meta_core_shade (display,
                                frame->xwindow,
                                event->time);
           }
@@ -1273,52 +1282,52 @@ meta_frame_titlebar_event (MetaUIFrame    *frame,
       
     case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE:
       {
-        meta_core_get (gdk_display, frame->xwindow,
+        meta_core_get (display, frame->xwindow,
                        META_CORE_GET_FRAME_FLAGS, &flags,
                        META_CORE_GET_END);
         
         if (flags & META_FRAME_ALLOWS_MAXIMIZE)
           {
-            meta_core_toggle_maximize (gdk_display, frame->xwindow);
+            meta_core_toggle_maximize (display, frame->xwindow);
           }
       }
       break;
 
     case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZONTALLY:
       {
-        meta_core_get (gdk_display, frame->xwindow,
+        meta_core_get (display, frame->xwindow,
                        META_CORE_GET_FRAME_FLAGS, &flags,
                        META_CORE_GET_END);
         
         if (flags & META_FRAME_ALLOWS_MAXIMIZE)
           {
-            meta_core_toggle_maximize_horizontally (gdk_display, frame->xwindow);
+            meta_core_toggle_maximize_horizontally (display, frame->xwindow);
           }
       }
       break;
 
     case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERTICALLY:
       {
-        meta_core_get (gdk_display, frame->xwindow,
+        meta_core_get (display, frame->xwindow,
                        META_CORE_GET_FRAME_FLAGS, &flags,
                        META_CORE_GET_END);
         
         if (flags & META_FRAME_ALLOWS_MAXIMIZE)
           {
-            meta_core_toggle_maximize_vertically (gdk_display, frame->xwindow);
+            meta_core_toggle_maximize_vertically (display, frame->xwindow);
           }
       }
       break;
 
     case META_ACTION_TITLEBAR_MINIMIZE:
       {
-        meta_core_get (gdk_display, frame->xwindow,
+        meta_core_get (display, frame->xwindow,
                        META_CORE_GET_FRAME_FLAGS, &flags,
                        META_CORE_GET_END);
         
         if (flags & META_FRAME_ALLOWS_MINIMIZE)
           {
-            meta_core_minimize (gdk_display, frame->xwindow);
+            meta_core_minimize (display, frame->xwindow);
           }
       }
       break;
@@ -1328,13 +1337,13 @@ meta_frame_titlebar_event (MetaUIFrame    *frame,
       break;
     
     case META_ACTION_TITLEBAR_LOWER:
-      meta_core_user_lower_and_unfocus (gdk_display,
+      meta_core_user_lower_and_unfocus (display,
                                         frame->xwindow,
                                         event->time);
       break;
 
     case META_ACTION_TITLEBAR_MENU:
-      meta_core_show_window_menu (gdk_display,
+      meta_core_show_window_menu (display,
                                   frame->xwindow,
                                   event->x_root,
                                   event->y_root,
@@ -1383,8 +1392,10 @@ meta_frames_button_press_event (GtkWidget      *widget,
   MetaUIFrame *frame;
   MetaFrames *frames;
   MetaFrameControl control;
+  Display *display;
   
   frames = META_FRAMES (widget);
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
 
   /* Remember that the display may have already done something with this event.
    * If so there's probably a GrabOp in effect.
@@ -1407,7 +1418,7 @@ meta_frames_button_press_event (GtkWidget      *widget,
       meta_topic (META_DEBUG_FOCUS,
                   "Focusing window with frame 0x%lx due to button 1 press\n",
                   frame->xwindow);
-      meta_core_user_focus (gdk_display,
+      meta_core_user_focus (display,
                             frame->xwindow,
                             event->time);      
     }
@@ -1423,11 +1434,11 @@ meta_frames_button_press_event (GtkWidget      *widget,
       event->button == 1 &&
       event->type == GDK_2BUTTON_PRESS)
     {
-      meta_core_end_grab_op (gdk_display, event->time);
+      meta_core_end_grab_op (display, event->time);
       return meta_frame_double_click_event (frame, event);
     }
 
-  if (meta_core_get_grab_op (gdk_display) !=
+  if (meta_core_get_grab_op (display) !=
       META_GRAB_OP_NONE)
     return FALSE; /* already up to something */  
 
@@ -1486,7 +1497,7 @@ meta_frames_button_press_event (GtkWidget      *widget,
           break;
         }
 
-      meta_core_begin_grab_op (gdk_display,
+      meta_core_begin_grab_op (display,
                                frame->xwindow,
                                op,
                                TRUE,
@@ -1518,7 +1529,7 @@ meta_frames_button_press_event (GtkWidget      *widget,
           if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
             dx += rect->width;
 
-          meta_core_show_window_menu (gdk_display,
+          meta_core_show_window_menu (display,
                                       frame->xwindow,
                                       rect->x + dx,
                                       rect->y + rect->height + dy,
@@ -1572,19 +1583,19 @@ meta_frames_button_press_event (GtkWidget      *widget,
           break;
         }
 
-      meta_core_get (gdk_display, frame->xwindow,
+      meta_core_get (display, frame->xwindow,
                      META_CORE_IS_TITLEBAR_ONSCREEN, &titlebar_is_onscreen,
                      META_CORE_GET_END);
 
       if (!titlebar_is_onscreen)
-        meta_core_show_window_menu (gdk_display,
+        meta_core_show_window_menu (display,
                                     frame->xwindow,
                                     event->x_root,
                                     event->y_root,
                                     event->button,
                                     event->time);
       else
-        meta_core_begin_grab_op (gdk_display,
+        meta_core_begin_grab_op (display,
                                  frame->xwindow,
                                  op,
                                  TRUE,
@@ -1600,13 +1611,13 @@ meta_frames_button_press_event (GtkWidget      *widget,
     {
       MetaFrameFlags flags;
 
-      meta_core_get (gdk_display, frame->xwindow,
+      meta_core_get (display, frame->xwindow,
                      META_CORE_GET_FRAME_FLAGS, &flags,
                      META_CORE_GET_END);
 
       if (flags & META_FRAME_ALLOWS_MOVE)
         {          
-          meta_core_begin_grab_op (gdk_display,
+          meta_core_begin_grab_op (display,
                                    frame->xwindow,
                                    META_GRAB_OP_MOVING,
                                    TRUE,
@@ -1633,12 +1644,13 @@ meta_frames_button_press_event (GtkWidget      *widget,
 void
 meta_frames_notify_menu_hide (MetaFrames *frames)
 {
-  if (meta_core_get_grab_op (gdk_display) ==
+  Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+  if (meta_core_get_grab_op (display) ==
       META_GRAB_OP_CLICKING_MENU)
     {
       Window grab_frame;
 
-      grab_frame = meta_core_get_grab_frame (gdk_display);
+      grab_frame = meta_core_get_grab_frame (display);
 
       if (grab_frame != None)
         {
@@ -1650,7 +1662,7 @@ meta_frames_notify_menu_hide (MetaFrames *frames)
             {
               redraw_control (frames, frame,
                               META_FRAME_CONTROL_MENU);
-              meta_core_end_grab_op (gdk_display, CurrentTime);
+              meta_core_end_grab_op (display, CurrentTime);
             }
         }
     }
@@ -1663,8 +1675,10 @@ meta_frames_button_release_event    (GtkWidget           *widget,
   MetaUIFrame *frame;
   MetaFrames *frames;
   MetaGrabOp op;
+  Display *display;
   
   frames = META_FRAMES (widget);
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
   
   frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
   if (frame == NULL)
@@ -1672,7 +1686,7 @@ meta_frames_button_release_event    (GtkWidget           *widget,
 
   clear_tip (frames);
 
-  op = meta_core_get_grab_op (gdk_display);
+  op = meta_core_get_grab_op (display);
 
   if (op == META_GRAB_OP_NONE)
     return FALSE;
@@ -1681,8 +1695,8 @@ meta_frames_button_release_event    (GtkWidget           *widget,
    * involving frame controls). Window ops that don't require a
    * frame are handled in the Xlib part of the code, display.c/window.c
    */
-  if (frame->xwindow == meta_core_get_grab_frame (gdk_display) &&
-      ((int) event->button) == meta_core_get_grab_button (gdk_display))
+  if (frame->xwindow == meta_core_get_grab_frame (display) &&
+      ((int) event->button) == meta_core_get_grab_button (display))
     {
       MetaFrameControl control;
 
@@ -1692,81 +1706,81 @@ meta_frames_button_release_event    (GtkWidget           *widget,
         {
         case META_GRAB_OP_CLICKING_MINIMIZE:
           if (control == META_FRAME_CONTROL_MINIMIZE)
-            meta_core_minimize (gdk_display, frame->xwindow);
+            meta_core_minimize (display, frame->xwindow);
           
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
 
         case META_GRAB_OP_CLICKING_MAXIMIZE:
           if (control == META_FRAME_CONTROL_MAXIMIZE)
           {
             /* Focus the window on the maximize */
-            meta_core_user_focus (gdk_display,
+            meta_core_user_focus (display,
                             frame->xwindow,
                             event->time);      
-            meta_core_maximize (gdk_display, frame->xwindow);
+            meta_core_maximize (display, frame->xwindow);
           }
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
 
         case META_GRAB_OP_CLICKING_UNMAXIMIZE:
           if (control == META_FRAME_CONTROL_UNMAXIMIZE)
-            meta_core_unmaximize (gdk_display, frame->xwindow);
+            meta_core_unmaximize (display, frame->xwindow);
           
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
           
         case META_GRAB_OP_CLICKING_DELETE:
           if (control == META_FRAME_CONTROL_DELETE)
-            meta_core_delete (gdk_display, frame->xwindow, event->time);
+            meta_core_delete (display, frame->xwindow, event->time);
           
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
           
         case META_GRAB_OP_CLICKING_MENU:
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
 
         case META_GRAB_OP_CLICKING_SHADE:
           if (control == META_FRAME_CONTROL_SHADE)
-            meta_core_shade (gdk_display, frame->xwindow, event->time);
+            meta_core_shade (display, frame->xwindow, event->time);
           
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
  
         case META_GRAB_OP_CLICKING_UNSHADE:
           if (control == META_FRAME_CONTROL_UNSHADE)
-            meta_core_unshade (gdk_display, frame->xwindow, event->time);
+            meta_core_unshade (display, frame->xwindow, event->time);
 
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
 
         case META_GRAB_OP_CLICKING_ABOVE:
           if (control == META_FRAME_CONTROL_ABOVE)
-            meta_core_make_above (gdk_display, frame->xwindow);
+            meta_core_make_above (display, frame->xwindow);
           
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
  
         case META_GRAB_OP_CLICKING_UNABOVE:
           if (control == META_FRAME_CONTROL_UNABOVE)
-            meta_core_unmake_above (gdk_display, frame->xwindow);
+            meta_core_unmake_above (display, frame->xwindow);
 
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
 
         case META_GRAB_OP_CLICKING_STICK:
           if (control == META_FRAME_CONTROL_STICK)
-            meta_core_stick (gdk_display, frame->xwindow);
+            meta_core_stick (display, frame->xwindow);
 
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
  
         case META_GRAB_OP_CLICKING_UNSTICK:
           if (control == META_FRAME_CONTROL_UNSTICK)
-            meta_core_unstick (gdk_display, frame->xwindow);
+            meta_core_unstick (display, frame->xwindow);
 
-          meta_core_end_grab_op (gdk_display, event->time);
+          meta_core_end_grab_op (display, event->time);
           break;
           
         default:
@@ -1855,7 +1869,7 @@ meta_frames_update_prelit_control (MetaFrames      *frames,
     }        
 
   /* set/unset the prelight cursor */
-  meta_core_set_screen_cursor (gdk_display,
+  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                                frame->xwindow,
                                cursor);  
 
@@ -1899,8 +1913,10 @@ meta_frames_motion_notify_event     (GtkWidget           *widget,
   MetaUIFrame *frame;
   MetaFrames *frames;
   MetaGrabOp grab_op;
+  Display *display;
   
   frames = META_FRAMES (widget);
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
   
   frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
   if (frame == NULL)
@@ -1910,7 +1926,7 @@ meta_frames_motion_notify_event     (GtkWidget           *widget,
 
   frames->last_motion_frame = frame;
 
-  grab_op = meta_core_get_grab_op (gdk_display);
+  grab_op = meta_core_get_grab_op (display);
   
   switch (grab_op)
     {
@@ -2136,7 +2152,8 @@ populate_cache (MetaFrames *frames,
   MetaFrameFlags frame_flags;
   int i;
 
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+                 frame->xwindow,
                  META_CORE_GET_FRAME_WIDTH, &frame_width,
                  META_CORE_GET_FRAME_HEIGHT, &frame_height,
                  META_CORE_GET_SCREEN_WIDTH, &screen_width,
@@ -2212,7 +2229,8 @@ clip_to_screen (MetaRegion *region, MetaUIFrame *frame)
    * is crucial to handle huge client windows,
    * like "xterm -geometry 1000x1000"
    */
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+                 frame->xwindow,
                  META_CORE_GET_FRAME_X, &frame_area.x,
                  META_CORE_GET_FRAME_Y, &frame_area.y,
                  META_CORE_GET_FRAME_WIDTH, &frame_area.width,
@@ -2336,14 +2354,16 @@ meta_frames_paint_to_drawable (MetaFrames   *frames,
   int i;
   MetaButtonLayout button_layout;
   MetaGrabOp grab_op;
+  Display *display;
   
   widget = GTK_WIDGET (frames);
+  display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
 
   for (i = 0; i < META_BUTTON_TYPE_LAST; i++)
     button_states[i] = META_BUTTON_STATE_NORMAL;
 
-  grab_frame = meta_core_get_grab_frame (gdk_display);
-  grab_op = meta_core_get_grab_op (gdk_display);
+  grab_frame = meta_core_get_grab_frame (display);
+  grab_op = meta_core_get_grab_op (display);
   if (grab_frame != frame->xwindow)
     grab_op = META_GRAB_OP_NONE;
   
@@ -2434,7 +2454,7 @@ meta_frames_paint_to_drawable (MetaFrames   *frames,
   button_states[META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND] =
     button_states[META_BUTTON_TYPE_CLOSE];
   
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (display, frame->xwindow,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_FRAME_TYPE, &type,
                  META_CORE_GET_MINI_ICON, &mini_icon,
@@ -2463,7 +2483,7 @@ meta_frames_paint_to_drawable (MetaFrames   *frames,
                              type, frame->text_height, flags, 
                              &top, &bottom, &left, &right);
 
-      meta_core_get (gdk_display, frame->xwindow,
+      meta_core_get (display, frame->xwindow,
                      META_CORE_GET_SCREEN_WIDTH, &screen_width,
                      META_CORE_GET_SCREEN_HEIGHT, &screen_height,
                      META_CORE_GET_END);
@@ -2559,7 +2579,7 @@ meta_frames_set_window_background (MetaFrames   *frames,
   MetaFrameStyle *style = NULL;
   gboolean frame_exists;
 
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
                  META_CORE_WINDOW_HAS_FRAME, &frame_exists,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_FRAME_TYPE, &type,
@@ -2737,7 +2757,8 @@ get_control (MetaFrames *frames,
   if (POINT_IN_RECT (x, y, fgeom.menu_rect.clickable))
     return META_FRAME_CONTROL_MENU;
 
-  meta_core_get (gdk_display, frame->xwindow,
+  meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+                 frame->xwindow,
                  META_CORE_GET_FRAME_FLAGS, &flags,
                  META_CORE_GET_END);
   
@@ -2870,7 +2891,7 @@ meta_frames_push_delay_exposes (MetaFrames *frames)
     {
       /* Make sure we've repainted things */
       gdk_window_process_all_updates ();
-      XFlush (gdk_display);
+      XFlush (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
     }
   
   frames->expose_delay_count += 1;
diff --git a/src/ui/menu.c b/src/ui/menu.c
index 838bca8..ae58736 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -139,7 +139,8 @@ menu_closed (GtkMenu *widget,
   menu = data;
 
   meta_frames_notify_menu_hide (menu->frames);
-  (* menu->func) (menu, gdk_display,
+  (* menu->func) (menu,
+                  GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                   menu->client_xwindow,
                   gtk_get_current_event_time (),
                   0, 0,
@@ -158,7 +159,8 @@ activate_cb (GtkWidget *menuitem, gpointer data)
   md = data;
 
   meta_frames_notify_menu_hide (md->menu->frames);
-  (* md->menu->func) (md->menu, gdk_display,
+  (* md->menu->func) (md->menu,
+                      GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                       md->menu->client_xwindow,
                       gtk_get_current_event_time (),
                       md->op,
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 7dc4232..a7c1ee5 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -455,7 +455,8 @@ meta_ui_tab_popup_set_showing (MetaTabPopup *popup,
         {
           meta_verbose ("Hiding tab popup window\n");
           gtk_widget_hide (popup->window);
-          meta_core_increment_event_serial (gdk_display);
+          meta_core_increment_event_serial (
+              GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
         }
     }
 }
@@ -491,7 +492,8 @@ display_entry (MetaTabPopup *popup,
 
       /* Do stuff behind gtk's back */
       gdk_window_hide (window);
-      meta_core_increment_event_serial (gdk_display);
+      meta_core_increment_event_serial (
+          GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
   
       rect = te->rect;
       rect.x = 0;
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 5ddafb2..82df3e9 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -62,7 +62,7 @@ meta_ui_init (int *argc, char ***argv)
 Display*
 meta_ui_get_display (void)
 {
-  return gdk_display;
+  return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
 }
 
 typedef struct _EventFunc EventFunc;
@@ -126,7 +126,7 @@ meta_ui_new (Display *xdisplay,
   ui->xdisplay = xdisplay;
   ui->xscreen = screen;
 
-  g_assert (xdisplay == gdk_display);
+  g_assert (xdisplay == GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
   ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
   gtk_widget_realize (GTK_WIDGET (ui->frames));
   
@@ -408,7 +408,8 @@ meta_image_window_set_showing  (MetaImageWindow *iw,
   else
     {
       gtk_widget_hide (iw->window);
-      meta_core_increment_event_serial (gdk_display);
+      meta_core_increment_event_serial (
+          GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]