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