Rename errors.[ch] to meta-x11-errors.[ch]

Also rename meta_error_trap_* to meta_x11_error_trap_* and
move meta-x11-errors.c to src/x11

https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
Armin Krezović 2017-08-27 20:48:55 +02:00 committed by Jonas Ådahl
parent 2ac7afe8a9
commit 390314adfb
33 changed files with 193 additions and 194 deletions

View File

@ -14,7 +14,6 @@ src/compositor/meta-background.c
src/core/bell.c src/core/bell.c
src/core/core.c src/core/core.c
src/core/display.c src/core/display.c
src/core/errors.c
src/core/keybindings.c src/core/keybindings.c
src/core/main.c src/core/main.c
src/core/meta-close-dialog-default.c src/core/meta-close-dialog-default.c
@ -26,6 +25,7 @@ src/ui/frames.c
src/ui/theme.c src/ui/theme.c
src/wayland/meta-wayland-tablet-pad.c src/wayland/meta-wayland-tablet-pad.c
src/x11/meta-x11-display.c src/x11/meta-x11-display.c
src/x11/meta-x11-errors.c
src/x11/session.c src/x11/session.c
src/x11/window-props.c src/x11/window-props.c
src/x11/xprops.c src/x11/xprops.c

View File

@ -289,8 +289,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
core/edge-resistance.h \ core/edge-resistance.h \
core/events.c \ core/events.c \
core/events.h \ core/events.h \
core/errors.c \
meta/errors.h \
core/frame.c \ core/frame.c \
core/frame.h \ core/frame.h \
core/meta-gesture-tracker.c \ core/meta-gesture-tracker.c \
@ -332,6 +330,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
x11/meta-x11-display.c \ x11/meta-x11-display.c \
x11/meta-x11-display-private.h \ x11/meta-x11-display-private.h \
meta/meta-x11-display.h \ meta/meta-x11-display.h \
x11/meta-x11-errors.c \
meta/meta-x11-errors.h \
x11/events.c \ x11/events.c \
x11/events.h \ x11/events.h \
x11/group-private.h \ x11/group-private.h \
@ -536,7 +536,6 @@ libmutterinclude_headers = \
meta/compositor-mutter.h \ meta/compositor-mutter.h \
meta/compositor.h \ meta/compositor.h \
meta/display.h \ meta/display.h \
meta/errors.h \
meta/group.h \ meta/group.h \
meta/keybindings.h \ meta/keybindings.h \
meta/main.h \ meta/main.h \
@ -560,6 +559,7 @@ libmutterinclude_headers = \
meta/meta-window-group.h \ meta/meta-window-group.h \
meta/meta-window-shape.h \ meta/meta-window-shape.h \
meta/meta-x11-display.h \ meta/meta-x11-display.h \
meta/meta-x11-errors.h \
meta/prefs.h \ meta/prefs.h \
meta/theme.h \ meta/theme.h \
meta/types.h \ meta/types.h \

View File

@ -33,7 +33,7 @@
#include <string.h> #include <string.h>
#include <meta/main.h> #include <meta/main.h>
#include <meta/util.h> #include <meta/util.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <clutter/clutter.h> #include <clutter/clutter.h>

View File

@ -34,7 +34,7 @@
#include <meta/main.h> #include <meta/main.h>
#include "util-private.h" #include "util-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "edid.h" #include "edid.h"
#include "backends/meta-crtc.h" #include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h" #include "backends/meta-logical-monitor.h"

View File

@ -46,7 +46,7 @@
#include <unistd.h> #include <unistd.h>
#include <meta/main.h> #include <meta/main.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <gudev/gudev.h> #include <gudev/gudev.h>

View File

@ -35,7 +35,7 @@
#include <gudev/gudev.h> #include <gudev/gudev.h>
#endif #endif
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "backends/meta-logical-monitor.h" #include "backends/meta-logical-monitor.h"
typedef struct _MetaInputSettingsX11Private typedef struct _MetaInputSettingsX11Private
@ -63,9 +63,9 @@ device_free_xdevice (gpointer user_data)
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend)); Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
XDevice *xdev = user_data; XDevice *xdev = user_data;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XCloseDevice (xdisplay, xdev); XCloseDevice (xdisplay, xdev);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
static XDevice * static XDevice *
@ -81,9 +81,9 @@ device_ensure_xdevice (ClutterInputDevice *device)
if (xdev) if (xdev)
return xdev; return xdev;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
xdev = XOpenDevice (xdisplay, device_id); xdev = XOpenDevice (xdisplay, device_id);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
if (xdev) if (xdev)
{ {
@ -586,7 +586,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
return; return;
/* Grab the puke bucket! */ /* Grab the puke bucket! */
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
xdev = device_ensure_xdevice (device); xdev = device_ensure_xdevice (device);
if (xdev) if (xdev)
{ {
@ -595,7 +595,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
Absolute : Relative); Absolute : Relative);
} }
if (meta_error_trap_pop_with_return (display->x11_display)) if (meta_x11_error_trap_pop_with_return (display->x11_display))
{ {
g_warning ("Could not set tablet mapping for %s", g_warning ("Could not set tablet mapping for %s",
clutter_input_device_get_device_name (device)); clutter_input_device_get_device_name (device));
@ -782,7 +782,6 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
return; return;
/* Grab the puke bucket! */ /* Grab the puke bucket! */
meta_error_trap_push (display->x11_display);
xdev = device_ensure_xdevice (device); xdev = device_ensure_xdevice (device);
if (xdev) if (xdev)
{ {
@ -800,7 +799,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map)); XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map));
} }
if (meta_error_trap_pop_with_return (display->x11_display)) if (meta_x11_error_trap_pop_with_return (display->x11_display))
{ {
g_warning ("Could not set stylus button map for %s", g_warning ("Could not set stylus button map for %s",
clutter_input_device_get_device_name (device)); clutter_input_device_get_device_name (device));

View File

@ -39,7 +39,7 @@
#include "meta-backend-x11.h" #include "meta-backend-x11.h"
#include <meta/main.h> #include <meta/main.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "backends/meta-crtc.h" #include "backends/meta-crtc.h"
#include "backends/meta-monitor-config-manager.h" #include "backends/meta-monitor-config-manager.h"
#include "backends/meta-logical-monitor.h" #include "backends/meta-logical-monitor.h"

View File

@ -55,7 +55,7 @@
#include <clutter/x11/clutter-x11.h> #include <clutter/x11/clutter-x11.h>
#include "core.h" #include "core.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/window.h> #include <meta/window.h>
#include "compositor-private.h" #include "compositor-private.h"
#include <meta/compositor-mutter.h> #include <meta/compositor-mutter.h>
@ -467,11 +467,11 @@ redirect_windows (MetaX11Display *x11_display)
*/ */
while (TRUE) while (TRUE)
{ {
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual); XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
XSync (xdisplay, FALSE); XSync (xdisplay, FALSE);
if (!meta_error_trap_pop_with_return (x11_display)) if (!meta_x11_error_trap_pop_with_return (x11_display))
break; break;
if (n_retries == max_retries) if (n_retries == max_retries)
@ -663,12 +663,12 @@ meta_compositor_add_window (MetaCompositor *compositor,
{ {
MetaDisplay *display = compositor->display; MetaDisplay *display = compositor->display;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
meta_window_actor_new (window); meta_window_actor_new (window);
sync_actor_stacking (compositor); sync_actor_stacking (compositor);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
void void

View File

@ -78,7 +78,7 @@
#include "cogl-utils.h" #include "cogl-utils.h"
#include "clutter-utils.h" #include "clutter-utils.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "meta-background-actor-private.h" #include "meta-background-actor-private.h"
#include "meta-background-private.h" #include "meta-background-private.h"
#include "meta-cullable.h" #include "meta-cullable.h"

View File

@ -23,7 +23,7 @@
#include "compositor-private.h" #include "compositor-private.h"
#include "meta-plugin-manager.h" #include "meta-plugin-manager.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/workspace.h> #include <meta/workspace.h>
#include "meta-module.h" #include "meta-module.h"
#include "window-private.h" #include "window-private.h"

View File

@ -30,7 +30,7 @@
#include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xcomposite.h>
#include <cogl/winsys/cogl-texture-pixmap-x11.h> #include <cogl/winsys/cogl-texture-pixmap-x11.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "window-private.h" #include "window-private.h"
#include "meta-shaped-texture-private.h" #include "meta-shaped-texture-private.h"
#include "meta-cullable.h" #include "meta-cullable.h"
@ -74,10 +74,10 @@ free_damage (MetaSurfaceActorX11 *self)
if (priv->damage == None) if (priv->damage == None)
return; return;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XDamageDestroy (xdisplay, priv->damage); XDamageDestroy (xdisplay, priv->damage);
priv->damage = None; priv->damage = None;
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
static void static void
@ -98,10 +98,10 @@ detach_pixmap (MetaSurfaceActorX11 *self)
meta_shaped_texture_set_texture (stex, NULL); meta_shaped_texture_set_texture (stex, NULL);
cogl_flush (); cogl_flush ();
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XFreePixmap (xdisplay, priv->pixmap); XFreePixmap (xdisplay, priv->pixmap);
priv->pixmap = None; priv->pixmap = None;
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
g_clear_pointer (&priv->texture, cogl_object_unref); g_clear_pointer (&priv->texture, cogl_object_unref);
} }
@ -152,10 +152,10 @@ update_pixmap (MetaSurfaceActorX11 *self)
Pixmap new_pixmap; Pixmap new_pixmap;
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window); Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow); new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
if (meta_error_trap_pop_with_return (display->x11_display) != Success) if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
{ {
/* Probably a BadMatch if the window isn't viewable; we could /* Probably a BadMatch if the window isn't viewable; we could
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync * GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
@ -228,9 +228,9 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
if (priv->received_damage) if (priv->received_damage)
{ {
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XDamageSubtract (xdisplay, priv->damage, None, None); XDamageSubtract (xdisplay, priv->damage, None, None);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
priv->received_damage = FALSE; priv->received_damage = FALSE;
} }
@ -315,7 +315,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display); Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window); Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
if (priv->unredirected) if (priv->unredirected)
{ {
@ -327,7 +327,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual); XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
} }
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
static void static void

View File

@ -16,7 +16,7 @@
#include <string.h> #include <string.h>
#include <meta/display.h> #include <meta/display.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "frame.h" #include "frame.h"
#include <meta/window.h> #include <meta/window.h>
#include <meta/meta-shaped-texture.h> #include <meta/meta-shaped-texture.h>
@ -1990,10 +1990,10 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff); ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
ev.data.l[3] = frame->frame_drawn_time >> 32; ev.data.l[3] = frame->frame_drawn_time >> 32;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev); XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
XFlush (xdisplay); XFlush (xdisplay);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
void void
@ -2067,10 +2067,10 @@ do_send_frame_timings (MetaWindowActor *self,
ev.data.l[3] = refresh_interval; ev.data.l[3] = refresh_interval;
ev.data.l[4] = 1000 * META_SYNC_DELAY; ev.data.l[4] = 1000 * META_SYNC_DELAY;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev); XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
XFlush (xdisplay); XFlush (xdisplay);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
static void static void

View File

@ -26,7 +26,7 @@
#include "frame.h" #include "frame.h"
#include "workspace-private.h" #include "workspace-private.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "util-private.h" #include "util-private.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"

View File

@ -26,7 +26,7 @@
#include "util-private.h" #include "util-private.h"
#include "window-private.h" #include "window-private.h"
#include "compositor-private.h" #include "compositor-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/workspace.h> #include <meta/workspace.h>
#include <errno.h> #include <errno.h>

View File

@ -39,7 +39,7 @@
#include "window-private.h" #include "window-private.h"
#include "boxes-private.h" #include "boxes-private.h"
#include "frame.h" #include "frame.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "keybindings-private.h" #include "keybindings-private.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include "workspace-private.h" #include "workspace-private.h"

View File

@ -24,7 +24,7 @@
#include <config.h> #include <config.h>
#include "frame.h" #include "frame.h"
#include "bell.h" #include "bell.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "keybindings-private.h" #include "keybindings-private.h"
#include "backends/x11/meta-backend-x11.h" #include "backends/x11/meta-backend-x11.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
@ -87,7 +87,7 @@ meta_window_ensure_frame (MetaWindow *window)
meta_x11_display_register_x_window (x11_display, &frame->xwindow, window); meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
if (window->mapped) if (window->mapped)
{ {
window->mapped = FALSE; /* the reparent will unmap the window, window->mapped = FALSE; /* the reparent will unmap the window,
@ -107,7 +107,7 @@ meta_window_ensure_frame (MetaWindow *window)
frame->child_x, frame->child_x,
frame->child_y); frame->child_y);
/* FIXME handle this error */ /* FIXME handle this error */
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
/* stick frame to the window */ /* stick frame to the window */
window->frame = frame; window->frame = frame;
@ -174,7 +174,7 @@ meta_window_destroy_frame (MetaWindow *window)
/* Unparent the client window; it may be destroyed, /* Unparent the client window; it may be destroyed,
* thus the error trap. * thus the error trap.
*/ */
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
if (window->mapped) if (window->mapped)
{ {
window->mapped = FALSE; /* Keep track of unmapping it, so we window->mapped = FALSE; /* Keep track of unmapping it, so we
@ -197,7 +197,7 @@ meta_window_destroy_frame (MetaWindow *window)
*/ */
window->frame->rect.x + borders.invisible.left, window->frame->rect.x + borders.invisible.left,
window->frame->rect.y + borders.invisible.top); window->frame->rect.y + borders.invisible.top);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_ui_frame_unmanage (frame->ui_frame); meta_ui_frame_unmanage (frame->ui_frame);

View File

@ -31,7 +31,7 @@
#include "keybindings-private.h" #include "keybindings-private.h"
#include "workspace-private.h" #include "workspace-private.h"
#include <meta/compositor.h> #include <meta/compositor.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "edge-resistance.h" #include "edge-resistance.h"
#include "frame.h" #include "frame.h"
#include <meta/prefs.h> #include <meta/prefs.h>
@ -3031,7 +3031,7 @@ handle_panel (MetaDisplay *display,
"off due to keybinding press\n", event->time); "off due to keybinding press\n", event->time);
display->mouse_mode = FALSE; display->mouse_mode = FALSE;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
/* Release the grab for the panel before sending the event */ /* Release the grab for the panel before sending the event */
XUngrabKeyboard (x11_display->xdisplay, event->time); XUngrabKeyboard (x11_display->xdisplay, event->time);
@ -3042,7 +3042,7 @@ handle_panel (MetaDisplay *display,
StructureNotifyMask, StructureNotifyMask,
(XEvent*) &ev); (XEvent*) &ev);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void

View File

@ -47,7 +47,7 @@
#include <meta/main.h> #include <meta/main.h>
#include "util-private.h" #include "util-private.h"
#include "display-private.h" #include "display-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "ui.h" #include "ui.h"
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/compositor.h> #include <meta/compositor.h>

View File

@ -39,7 +39,7 @@
#include "frame.h" #include "frame.h"
#include "display-private.h" #include "display-private.h"
#include "stack-tracker.h" #include "stack-tracker.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/util.h> #include <meta/util.h>
#include <meta/compositor.h> #include <meta/compositor.h>
@ -1001,7 +1001,7 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker,
{ {
serial = XNextRequest (x11_display->xdisplay); serial = XNextRequest (x11_display->xdisplay);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
changes.stack_mode = changes.sibling ? Below : Above; changes.stack_mode = changes.sibling ? Below : Above;
@ -1010,7 +1010,7 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker,
(changes.sibling ? CWSibling : 0) | CWStackMode, (changes.sibling ? CWSibling : 0) | CWStackMode,
&changes); &changes);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
} }
@ -1036,7 +1036,7 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
{ {
serial = XNextRequest (x11_display->xdisplay); serial = XNextRequest (x11_display->xdisplay);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
changes.stack_mode = changes.sibling ? Above : Below; changes.stack_mode = changes.sibling ? Above : Below;
@ -1045,7 +1045,7 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
(changes.sibling ? CWSibling : 0) | CWStackMode, (changes.sibling ? CWSibling : 0) | CWStackMode,
&changes); &changes);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
} }

View File

@ -28,7 +28,7 @@
#include <config.h> #include <config.h>
#include "stack.h" #include "stack.h"
#include "window-private.h" #include "window-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "frame.h" #include "frame.h"
#include <meta/group.h> #include <meta/group.h>
#include <meta/prefs.h> #include <meta/prefs.h>

View File

@ -26,7 +26,7 @@
#include <glib-object.h> #include <glib-object.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "display-private.h" #include "display-private.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
#include "startup-notification-private.h" #include "startup-notification-private.h"
@ -584,7 +584,7 @@ sn_error_trap_push (SnDisplay *sn_display,
MetaDisplay *display; MetaDisplay *display;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
if (display != NULL) if (display != NULL)
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
} }
static void static void
@ -594,7 +594,7 @@ sn_error_trap_pop (SnDisplay *sn_display,
MetaDisplay *display; MetaDisplay *display;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
if (display != NULL) if (display != NULL)
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
static void static void

View File

@ -32,7 +32,7 @@
#include "edge-resistance.h" #include "edge-resistance.h"
#include "util-private.h" #include "util-private.h"
#include "frame.h" #include "frame.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "workspace-private.h" #include "workspace-private.h"
#include "stack.h" #include "stack.h"
#include "keybindings-private.h" #include "keybindings-private.h"
@ -761,7 +761,7 @@ sync_client_window_mapped (MetaWindow *window)
window->mapped = should_be_mapped; window->mapped = should_be_mapped;
meta_error_trap_push (window->display->x11_display); meta_x11_error_trap_push (window->display->x11_display);
if (should_be_mapped) if (should_be_mapped)
{ {
XMapWindow (window->display->x11_display->xdisplay, window->xwindow); XMapWindow (window->display->x11_display->xdisplay, window->xwindow);
@ -771,7 +771,7 @@ sync_client_window_mapped (MetaWindow *window)
XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow); XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow);
window->unmaps_pending ++; window->unmaps_pending ++;
} }
meta_error_trap_pop (window->display->x11_display); meta_x11_error_trap_pop (window->display->x11_display);
} }
static gboolean static gboolean
@ -6775,7 +6775,7 @@ warp_grab_pointer (MetaWindow *window,
*x = CLAMP (*x, 0, display_rect.width - 1); *x = CLAMP (*x, 0, display_rect.width - 1);
*y = CLAMP (*y, 0, display_rect.height - 1); *y = CLAMP (*y, 0, display_rect.height - 1);
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
meta_topic (META_DEBUG_WINDOW_OPS, meta_topic (META_DEBUG_WINDOW_OPS,
"Warping pointer to %d,%d with window at %d,%d\n", "Warping pointer to %d,%d with window at %d,%d\n",
@ -6797,7 +6797,7 @@ warp_grab_pointer (MetaWindow *window,
meta_backend_warp_pointer (backend, *x, *y); meta_backend_warp_pointer (backend, *x, *y);
} }
if (meta_error_trap_pop_with_return (display->x11_display) != Success) if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
{ {
meta_verbose ("Failed to warp pointer for window %s\n", meta_verbose ("Failed to warp pointer for window %s\n",
window->desc); window->desc);
@ -8044,14 +8044,14 @@ window_has_pointer_x11 (MetaWindow *window)
XIModifierState mods; XIModifierState mods;
XIGroupState group; XIGroupState group;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XIQueryPointer (x11_display->xdisplay, XIQueryPointer (x11_display->xdisplay,
META_VIRTUAL_CORE_POINTER_ID, META_VIRTUAL_CORE_POINTER_ID,
x11_display->xroot, x11_display->xroot,
&root, &child, &root, &child,
&root_x, &root_y, &x, &y, &root_x, &root_y, &x, &y,
&buttons, &mods, &group); &buttons, &mods, &group);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
free (buttons.mask); free (buttons.mask);
return meta_x11_display_lookup_x_window (x11_display, child) == window; return meta_x11_display_lookup_x_window (x11_display, child) == window;

View File

@ -38,7 +38,7 @@
#include <meta/workspace.h> #include <meta/workspace.h>
#include "workspace-private.h" #include "workspace-private.h"
#include "boxes-private.h" #include "boxes-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/compositor.h> #include <meta/compositor.h>

View File

@ -27,11 +27,11 @@
#include <meta/util.h> #include <meta/util.h>
#include <meta/meta-x11-display.h> #include <meta/meta-x11-display.h>
void meta_error_trap_push (MetaX11Display *x11_display); void meta_x11_error_trap_push (MetaX11Display *x11_display);
void meta_error_trap_pop (MetaX11Display *x11_display); void meta_x11_error_trap_pop (MetaX11Display *x11_display);
/* returns X error code, or 0 for no error */ /* returns X error code, or 0 for no error */
int meta_error_trap_pop_with_return (MetaX11Display *x11_display); int meta_x11_error_trap_pop_with_return (MetaX11Display *x11_display);
#endif #endif

View File

@ -26,7 +26,7 @@
#include "meta-window-wayland.h" #include "meta-window-wayland.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <errno.h> #include <errno.h>
#include <string.h> /* for strerror () */ #include <string.h> /* for strerror () */
#include "window-private.h" #include "window-private.h"
@ -614,7 +614,7 @@ meta_window_wayland_new (MetaDisplay *display,
* X requests (passing a window xid of None) until we thoroughly audit all * X requests (passing a window xid of None) until we thoroughly audit all
* the code to make sure it knows about non X based clients... * the code to make sure it knows about non X based clients...
*/ */
meta_error_trap_push (display->x11_display); /* Push a trap over all of window meta_x11_error_trap_push (display->x11_display); /* Push a trap over all of window
* creation, to reduce XSync() calls * creation, to reduce XSync() calls
*/ */
@ -627,7 +627,7 @@ meta_window_wayland_new (MetaDisplay *display,
&attrs); &attrs);
window->can_ping = TRUE; window->can_ping = TRUE;
meta_error_trap_pop (display->x11_display); /* pop the XSync()-reducing trap */ meta_x11_error_trap_pop (display->x11_display); /* pop the XSync()-reducing trap */
return window; return window;
} }

View File

@ -34,7 +34,7 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/extensions/Xfixes.h> #include <X11/extensions/Xfixes.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "meta-xwayland.h" #include "meta-xwayland.h"
#include "meta-xwayland-private.h" #include "meta-xwayland-private.h"
#include "meta-xwayland-selection-private.h" #include "meta-xwayland-selection-private.h"
@ -654,10 +654,10 @@ wayland_selection_data_free (WaylandSelectionData *data)
/* Do *not* change the event mask on the root window, bugger! */ /* Do *not* change the event mask on the root window, bugger! */
if (!data->window && data->request_event.requestor != x11_display->xroot) if (!data->window && data->request_event.requestor != x11_display->xroot)
{ {
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
data->request_event.requestor, NoEventMask); data->request_event.requestor, NoEventMask);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
g_cancellable_cancel (data->cancellable); g_cancellable_cancel (data->cancellable);

View File

@ -28,7 +28,7 @@
#include <X11/extensions/Xdamage.h> #include <X11/extensions/Xdamage.h>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "meta/meta-backend.h" #include "meta/meta-backend.h"
#include "bell.h" #include "bell.h"
#include "display-private.h" #include "display-private.h"
@ -537,10 +537,10 @@ meta_spew_core_event (MetaX11Display *x11_display,
name = "PropertyNotify"; name = "PropertyNotify";
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str = XGetAtomName (x11_display->xdisplay, str = XGetAtomName (x11_display->xdisplay,
event->xproperty.atom); event->xproperty.atom);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
if (event->xproperty.state == PropertyNewValue) if (event->xproperty.state == PropertyNewValue)
state = "PropertyNewValue"; state = "PropertyNewValue";
@ -571,10 +571,10 @@ meta_spew_core_event (MetaX11Display *x11_display,
{ {
char *str; char *str;
name = "ClientMessage"; name = "ClientMessage";
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str = XGetAtomName (x11_display->xdisplay, str = XGetAtomName (x11_display->xdisplay,
event->xclient.message_type); event->xclient.message_type);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
extra = g_strdup_printf ("type: %s format: %d\n", extra = g_strdup_printf ("type: %s format: %d\n",
str ? str : "(unknown atom)", str ? str : "(unknown atom)",
event->xclient.format); event->xclient.format);
@ -978,12 +978,12 @@ process_request_frame_extents (MetaX11Display *x11_display,
"to top = %lu, left = %lu, bottom = %lu, right = %lu\n", "to top = %lu, left = %lu, bottom = %lu, right = %lu\n",
xwindow, data[0], data[1], data[2], data[3]); xwindow, data[0], data[1], data[2], data[3]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, xwindow, XChangeProperty (x11_display->xdisplay, xwindow,
x11_display->atom__NET_FRAME_EXTENTS, x11_display->atom__NET_FRAME_EXTENTS,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 4); 32, PropModeReplace, (guchar*) data, 4);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_XFree (hints); meta_XFree (hints);
} }
@ -1004,7 +1004,7 @@ convert_property (MetaX11Display *x11_display,
conversion_targets[2] = x11_display->atom_TIMESTAMP; conversion_targets[2] = x11_display->atom_TIMESTAMP;
conversion_targets[3] = x11_display->atom_VERSION; conversion_targets[3] = x11_display->atom_VERSION;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
if (target == x11_display->atom_TARGETS) if (target == x11_display->atom_TARGETS)
XChangeProperty (x11_display->xdisplay, w, property, XChangeProperty (x11_display->xdisplay, w, property,
XA_ATOM, 32, PropModeReplace, XA_ATOM, 32, PropModeReplace,
@ -1019,11 +1019,11 @@ convert_property (MetaX11Display *x11_display,
(unsigned char *)icccm_version, 2); (unsigned char *)icccm_version, 2);
else else
{ {
meta_error_trap_pop_with_return (x11_display); meta_x11_error_trap_pop_with_return (x11_display);
return FALSE; return FALSE;
} }
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
return FALSE; return FALSE;
/* Be sure the PropertyNotify has arrived so we /* Be sure the PropertyNotify has arrived so we
@ -1048,10 +1048,10 @@ process_selection_request (MetaX11Display *x11_display,
{ {
char *str; char *str;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str = XGetAtomName (x11_display->xdisplay, str = XGetAtomName (x11_display->xdisplay,
event->xselectionrequest.selection); event->xselectionrequest.selection);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_verbose ("Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize\n", meta_verbose ("Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
str ? str : "(bad atom)", event->xselectionrequest.owner); str ? str : "(bad atom)", event->xselectionrequest.owner);
@ -1078,18 +1078,18 @@ process_selection_request (MetaX11Display *x11_display,
unsigned long num, rest; unsigned long num, rest;
unsigned char *data; unsigned char *data;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
if (XGetWindowProperty (x11_display->xdisplay, if (XGetWindowProperty (x11_display->xdisplay,
event->xselectionrequest.requestor, event->xselectionrequest.requestor,
event->xselectionrequest.property, 0, 256, False, event->xselectionrequest.property, 0, 256, False,
x11_display->atom_ATOM_PAIR, x11_display->atom_ATOM_PAIR,
&type, &format, &num, &rest, &data) != Success) &type, &format, &num, &rest, &data) != Success)
{ {
meta_error_trap_pop_with_return (x11_display); meta_x11_error_trap_pop_with_return (x11_display);
return; return;
} }
if (meta_error_trap_pop_with_return (x11_display) == Success) if (meta_x11_error_trap_pop_with_return (x11_display) == Success)
{ {
/* FIXME: to be 100% correct, should deal with rest > 0, /* FIXME: to be 100% correct, should deal with rest > 0,
* but since we have 4 possible targets, we will hardly ever * but since we have 4 possible targets, we will hardly ever
@ -1106,13 +1106,13 @@ process_selection_request (MetaX11Display *x11_display,
i += 2; i += 2;
} }
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
event->xselectionrequest.requestor, event->xselectionrequest.requestor,
event->xselectionrequest.property, event->xselectionrequest.property,
x11_display->atom_ATOM_PAIR, x11_display->atom_ATOM_PAIR,
32, PropModeReplace, data, num); 32, PropModeReplace, data, num);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_XFree (data); meta_XFree (data);
} }
} }
@ -1145,10 +1145,10 @@ process_selection_clear (MetaX11Display *x11_display,
{ {
char *str; char *str;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str = XGetAtomName (x11_display->xdisplay, str = XGetAtomName (x11_display->xdisplay,
event->xselectionclear.selection); event->xselectionclear.selection);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_verbose ("Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize\n", meta_verbose ("Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
str ? str : "(bad atom)", event->xselectionclear.window); str ? str : "(bad atom)", event->xselectionclear.window);
@ -1312,9 +1312,9 @@ handle_other_xevent (MetaX11Display *x11_display,
{ {
meta_warning ("Unexpected destruction of frame 0x%lx, not sure if this should silently fail or be considered a bug\n", meta_warning ("Unexpected destruction of frame 0x%lx, not sure if this should silently fail or be considered a bug\n",
window->frame->xwindow); window->frame->xwindow);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
meta_window_destroy_frame (window->frame->window); meta_window_destroy_frame (window->frame->window);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
else else
{ {
@ -1451,10 +1451,10 @@ handle_other_xevent (MetaX11Display *x11_display,
meta_verbose ("Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in mask)\n", meta_verbose ("Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in mask)\n",
xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width); xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XConfigureWindow (x11_display->xdisplay, event->xconfigurerequest.window, XConfigureWindow (x11_display->xdisplay, event->xconfigurerequest.window,
xwcm, &xwc); xwcm, &xwc);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
else else
{ {

View File

@ -24,7 +24,7 @@
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
#include "iconcache.h" #include "iconcache.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <cairo.h> #include <cairo.h>
#include <cairo-xlib.h> #include <cairo-xlib.h>
@ -210,7 +210,7 @@ read_rgb_icon (MetaX11Display *x11_display,
int mini_w, mini_h; int mini_w, mini_h;
gulong *data_as_long; gulong *data_as_long;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
type = None; type = None;
data = NULL; data = NULL;
result = XGetWindowProperty (x11_display->xdisplay, result = XGetWindowProperty (x11_display->xdisplay,
@ -219,7 +219,7 @@ read_rgb_icon (MetaX11Display *x11_display,
0, G_MAXLONG, 0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems, False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, &data); &bytes_after, &data);
err = meta_error_trap_pop_with_return (x11_display); err = meta_x11_error_trap_pop_with_return (x11_display);
if (err != Success || if (err != Success ||
result != Success) result != Success)
@ -340,7 +340,7 @@ try_pixmap_and_mask (MetaX11Display *x11_display,
if (src_pixmap == None) if (src_pixmap == None)
return FALSE; return FALSE;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
get_pixmap_geometry (x11_display, src_pixmap, &w, &h, &d); get_pixmap_geometry (x11_display, src_pixmap, &w, &h, &d);
icon = surface_from_pixmap (xdisplay, src_pixmap, w, h); icon = surface_from_pixmap (xdisplay, src_pixmap, w, h);
@ -353,7 +353,7 @@ try_pixmap_and_mask (MetaX11Display *x11_display,
mask = surface_from_pixmap (xdisplay, src_mask, w, h); mask = surface_from_pixmap (xdisplay, src_mask, w, h);
} }
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
if (icon && mask) if (icon && mask)
{ {
@ -404,7 +404,7 @@ get_kwm_win_icon (MetaX11Display *x11_display,
*pixmap = None; *pixmap = None;
*mask = None; *mask = None;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
icons = NULL; icons = NULL;
result = XGetWindowProperty (x11_display->xdisplay, xwindow, result = XGetWindowProperty (x11_display->xdisplay, xwindow,
x11_display->atom__KWM_WIN_ICON, x11_display->atom__KWM_WIN_ICON,
@ -415,7 +415,7 @@ get_kwm_win_icon (MetaX11Display *x11_display,
&bytes_after, &data); &bytes_after, &data);
icons = (Pixmap *)data; icons = (Pixmap *)data;
err = meta_error_trap_pop_with_return (x11_display); err = meta_x11_error_trap_pop_with_return (x11_display);
if (err != Success || if (err != Success ||
result != Success) result != Success)
return; return;

View File

@ -57,8 +57,8 @@
#include "core/frame.h" #include "core/frame.h"
#include "core/util-private.h" #include "core/util-private.h"
#include "core/workspace-private.h" #include "core/workspace-private.h"
#include "meta/errors.h"
#include "meta/main.h" #include "meta/main.h"
#include "meta/meta-x11-errors.h"
#include "x11/events.h" #include "x11/events.h"
#include "x11/group-props.h" #include "x11/group-props.h"
@ -187,9 +187,9 @@ meta_x11_display_dispose (GObject *object)
{ {
unset_wm_check_hint (x11_display); unset_wm_check_hint (x11_display);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XSelectInput (x11_display->xdisplay, x11_display->xroot, 0); XSelectInput (x11_display->xdisplay, x11_display->xroot, 0);
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
meta_warning ("Could not release screen %d on display \"%s\"\n", meta_warning ("Could not release screen %d on display \"%s\"\n",
DefaultScreen (x11_display->xdisplay), DefaultScreen (x11_display->xdisplay),
x11_display->name); x11_display->name);
@ -519,13 +519,13 @@ set_desktop_geometry_hint (MetaX11Display *x11_display)
meta_verbose ("Setting _NET_DESKTOP_GEOMETRY to %lu, %lu\n", data[0], data[1]); meta_verbose ("Setting _NET_DESKTOP_GEOMETRY to %lu, %lu\n", data[0], data[1]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_DESKTOP_GEOMETRY, x11_display->atom__NET_DESKTOP_GEOMETRY,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 2); 32, PropModeReplace, (guchar*) data, 2);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -544,13 +544,13 @@ set_desktop_viewport_hint (MetaX11Display *x11_display)
meta_verbose ("Setting _NET_DESKTOP_VIEWPORT to 0, 0\n"); meta_verbose ("Setting _NET_DESKTOP_VIEWPORT to 0, 0\n");
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_DESKTOP_VIEWPORT, x11_display->atom__NET_DESKTOP_VIEWPORT,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 2); 32, PropModeReplace, (guchar*) data, 2);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static int static int
@ -651,10 +651,10 @@ take_manager_selection (MetaX11Display *x11_display,
if (should_replace) if (should_replace)
{ {
/* We want to find out when the current selection owner dies */ /* We want to find out when the current selection owner dies */
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
attrs.event_mask = StructureNotifyMask; attrs.event_mask = StructureNotifyMask;
XChangeWindowAttributes (x11_display->xdisplay, current_owner, CWEventMask, &attrs); XChangeWindowAttributes (x11_display->xdisplay, current_owner, CWEventMask, &attrs);
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
current_owner = None; /* don't wait for it to die later on */ current_owner = None; /* don't wait for it to die later on */
} }
else else
@ -811,13 +811,13 @@ set_active_workspace_hint (MetaDisplay *display,
meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]); meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_CURRENT_DESKTOP, x11_display->atom__NET_CURRENT_DESKTOP,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -835,13 +835,13 @@ set_number_of_spaces_hint (MetaDisplay *display,
meta_verbose ("Setting _NET_NUMBER_OF_DESKTOPS to %lu\n", data[0]); meta_verbose ("Setting _NET_NUMBER_OF_DESKTOPS to %lu\n", data[0]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_NUMBER_OF_DESKTOPS, x11_display->atom__NET_NUMBER_OF_DESKTOPS,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -852,13 +852,13 @@ set_showing_desktop_hint (MetaDisplay *display,
data[0] = display->active_workspace->showing_desktop ? 1 : 0; data[0] = display->active_workspace->showing_desktop ? 1 : 0;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_SHOWING_DESKTOP, x11_display->atom__NET_SHOWING_DESKTOP,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -887,14 +887,14 @@ set_workspace_names (MetaX11Display *x11_display)
++i; ++i;
} }
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_DESKTOP_NAMES, x11_display->atom__NET_DESKTOP_NAMES,
x11_display->atom_UTF8_STRING, x11_display->atom_UTF8_STRING,
8, PropModeReplace, 8, PropModeReplace,
(unsigned char *)flattened->str, flattened->len); (unsigned char *)flattened->str, flattened->len);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
g_string_free (flattened, TRUE); g_string_free (flattened, TRUE);
} }
@ -925,13 +925,13 @@ set_work_area_hint (MetaDisplay *display,
tmp += 4; tmp += 4;
} }
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_WORKAREA, x11_display->atom__NET_WORKAREA,
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, num_workspaces*4); (guchar*) data, num_workspaces*4);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
g_free (data); g_free (data);
} }
@ -1751,13 +1751,13 @@ meta_x11_display_update_active_window_hint (MetaX11Display *x11_display)
else else
data[0] = None; data[0] = None;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
x11_display->xroot, x11_display->xroot,
x11_display->atom__NET_ACTIVE_WINDOW, x11_display->atom__NET_ACTIVE_WINDOW,
XA_WINDOW, XA_WINDOW,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -1771,7 +1771,7 @@ request_xserver_input_focus_change (MetaX11Display *x11_display,
if (meta_display_timestamp_too_old (x11_display->display, &timestamp)) if (meta_display_timestamp_too_old (x11_display->display, &timestamp))
return; return;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
/* In order for mutter to know that the focus request succeeded, we track /* In order for mutter to know that the focus request succeeded, we track
* the serial of the "focus request" we made, but if we take the serial * the serial of the "focus request" we made, but if we take the serial
@ -1804,7 +1804,7 @@ request_xserver_input_focus_change (MetaX11Display *x11_display,
serial, serial,
TRUE); TRUE);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
x11_display->display->last_focus_time = timestamp; x11_display->display->last_focus_time = timestamp;

View File

@ -25,7 +25,7 @@
*/ */
#include <config.h> #include <config.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
@ -44,19 +44,19 @@
*/ */
void void
meta_error_trap_push (MetaX11Display *x11_display) meta_x11_error_trap_push (MetaX11Display *x11_display)
{ {
gdk_x11_display_error_trap_push (x11_display->gdk_display); gdk_x11_display_error_trap_push (x11_display->gdk_display);
} }
void void
meta_error_trap_pop (MetaX11Display *x11_display) meta_x11_error_trap_pop (MetaX11Display *x11_display)
{ {
gdk_x11_display_error_trap_pop_ignored (x11_display->gdk_display); gdk_x11_display_error_trap_pop_ignored (x11_display->gdk_display);
} }
int int
meta_error_trap_pop_with_return (MetaX11Display *x11_display) meta_x11_error_trap_pop_with_return (MetaX11Display *x11_display)
{ {
return gdk_x11_display_error_trap_pop (x11_display->gdk_display); return gdk_x11_display_error_trap_pop (x11_display->gdk_display);
} }

View File

@ -41,7 +41,7 @@
#include "window-x11.h" #include "window-x11.h"
#include "window-x11-private.h" #include "window-x11-private.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "xprops.h" #include "xprops.h"
#include "frame.h" #include "frame.h"
#include <meta/group.h> #include <meta/group.h>
@ -576,11 +576,11 @@ set_title_text (MetaWindow *window,
/* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */ /* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */
if (!modified && previous_was_modified) if (!modified && previous_was_modified)
{ {
meta_error_trap_push (window->display->x11_display); meta_x11_error_trap_push (window->display->x11_display);
XDeleteProperty (window->display->x11_display->xdisplay, XDeleteProperty (window->display->x11_display->xdisplay,
window->xwindow, window->xwindow,
atom); atom);
meta_error_trap_pop (window->display->x11_display); meta_x11_error_trap_pop (window->display->x11_display);
} }
return modified; return modified;

View File

@ -39,7 +39,7 @@
#include "core.h" #include "core.h"
#include <meta/common.h> #include <meta/common.h>
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/meta-cursor-tracker.h> #include <meta/meta-cursor-tracker.h>
@ -93,10 +93,10 @@ send_icccm_message (MetaWindow *window,
ev.data.l[0] = atom; ev.data.l[0] = atom;
ev.data.l[1] = timestamp; ev.data.l[1] = timestamp;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XSendEvent (x11_display->xdisplay, XSendEvent (x11_display->xdisplay,
window->xwindow, False, 0, (XEvent*) &ev); window->xwindow, False, 0, (XEvent*) &ev);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static Window static Window
@ -250,11 +250,11 @@ send_configure_notify (MetaWindow *window)
event.xconfigure.x, event.xconfigure.y, event.xconfigure.x, event.xconfigure.y,
event.xconfigure.width, event.xconfigure.height); event.xconfigure.width, event.xconfigure.height);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XSendEvent (x11_display->xdisplay, XSendEvent (x11_display->xdisplay,
window->xwindow, window->xwindow,
False, StructureNotifyMask, &event); False, StructureNotifyMask, &event);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -579,7 +579,7 @@ meta_window_x11_unmanage (MetaWindow *window)
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
meta_window_x11_destroy_sync_request_alarm (window); meta_window_x11_destroy_sync_request_alarm (window);
@ -659,7 +659,7 @@ meta_window_x11_unmanage (MetaWindow *window)
meta_display_ungrab_window_buttons (window->display, window->xwindow); meta_display_ungrab_window_buttons (window->display, window->xwindow);
meta_display_ungrab_focus_window_button (window->display, window); meta_display_ungrab_focus_window_button (window->display, window);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
if (window->frame) if (window->frame)
{ {
@ -688,7 +688,7 @@ meta_window_x11_delete (MetaWindow *window,
{ {
MetaX11Display *x11_display = window->display->x11_display; MetaX11Display *x11_display = window->display->x11_display;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
if (window->delete_window) if (window->delete_window)
{ {
meta_topic (META_DEBUG_WINDOW_OPS, meta_topic (META_DEBUG_WINDOW_OPS,
@ -703,7 +703,7 @@ meta_window_x11_delete (MetaWindow *window,
window->desc); window->desc);
XKillClient (x11_display->xdisplay, window->xwindow); XKillClient (x11_display->xdisplay, window->xwindow);
} }
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -715,9 +715,9 @@ meta_window_x11_kill (MetaWindow *window)
"Disconnecting %s with XKillClient()\n", "Disconnecting %s with XKillClient()\n",
window->desc); window->desc);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XKillClient (x11_display->xdisplay, window->xwindow); XKillClient (x11_display->xdisplay, window->xwindow);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -901,12 +901,12 @@ update_net_frame_extents (MetaWindow *window)
"to left = %lu, right = %lu, top = %lu, bottom = %lu\n", "to left = %lu, right = %lu, top = %lu, bottom = %lu\n",
window->xwindow, data[0], data[1], data[2], data[3]); window->xwindow, data[0], data[1], data[2], data[3]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, window->xwindow, XChangeProperty (x11_display->xdisplay, window->xwindow,
x11_display->atom__NET_FRAME_EXTENTS, x11_display->atom__NET_FRAME_EXTENTS,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 4); 32, PropModeReplace, (guchar*) data, 4);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -928,13 +928,13 @@ update_gtk_edge_constraints (MetaWindow *window)
meta_verbose ("Setting _GTK_EDGE_CONSTRAINTS to %lu\n", data[0]); meta_verbose ("Setting _GTK_EDGE_CONSTRAINTS to %lu\n", data[0]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
window->xwindow, window->xwindow,
x11_display->atom__GTK_EDGE_CONSTRAINTS, x11_display->atom__GTK_EDGE_CONSTRAINTS,
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, 1); (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static gboolean static gboolean
@ -1049,12 +1049,12 @@ meta_window_x11_current_workspace_changed (MetaWindow *window)
meta_verbose ("Setting _NET_WM_DESKTOP of %s to %lu\n", meta_verbose ("Setting _NET_WM_DESKTOP of %s to %lu\n",
window->desc, data[0]); window->desc, data[0]);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, window->xwindow, XChangeProperty (x11_display->xdisplay, window->xwindow,
x11_display->atom__NET_WM_DESKTOP, x11_display->atom__NET_WM_DESKTOP,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static void static void
@ -1256,7 +1256,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window,
if (mask != 0) if (mask != 0)
{ {
meta_error_trap_push (window->display->x11_display); meta_x11_error_trap_push (window->display->x11_display);
if (window == window->display->grab_window && if (window == window->display->grab_window &&
meta_grab_op_is_resizing (window->display->grab_op) && meta_grab_op_is_resizing (window->display->grab_op) &&
@ -1273,7 +1273,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window,
mask, mask,
&values); &values);
meta_error_trap_pop (window->display->x11_display); meta_x11_error_trap_pop (window->display->x11_display);
} }
if (!configure_frame_first && window->frame) if (!configure_frame_first && window->frame)
@ -1679,12 +1679,12 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
meta_verbose ("Setting _NET_WM_STATE with %d atoms\n", i); meta_verbose ("Setting _NET_WM_STATE with %d atoms\n", i);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, window->xwindow, XChangeProperty (x11_display->xdisplay, window->xwindow,
x11_display->atom__NET_WM_STATE, x11_display->atom__NET_WM_STATE,
XA_ATOM, XA_ATOM,
32, PropModeReplace, (guchar*) data, i); 32, PropModeReplace, (guchar*) data, i);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
if (window->fullscreen) if (window->fullscreen)
{ {
@ -1704,22 +1704,22 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
window->fullscreen_monitors.right); window->fullscreen_monitors.right);
meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n"); meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
window->xwindow, window->xwindow,
x11_display->atom__NET_WM_FULLSCREEN_MONITORS, x11_display->atom__NET_WM_FULLSCREEN_MONITORS,
XA_CARDINAL, 32, PropModeReplace, XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, 4); (guchar*) data, 4);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
else else
{ {
meta_verbose ("Clearing _NET_WM_FULLSCREEN_MONITORS\n"); meta_verbose ("Clearing _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XDeleteProperty (x11_display->xdisplay, XDeleteProperty (x11_display->xdisplay,
window->xwindow, window->xwindow,
x11_display->atom__NET_WM_FULLSCREEN_MONITORS); x11_display->atom__NET_WM_FULLSCREEN_MONITORS);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
} }
@ -1807,13 +1807,13 @@ meta_window_x11_update_input_region (MetaWindow *window)
XRectangle *rects = NULL; XRectangle *rects = NULL;
int n_rects = -1, ordering; int n_rects = -1, ordering;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
rects = XShapeGetRectangles (x11_display->xdisplay, rects = XShapeGetRectangles (x11_display->xdisplay,
window->xwindow, window->xwindow,
ShapeInput, ShapeInput,
&n_rects, &n_rects,
&ordering); &ordering);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
/* XXX: The X Shape specification is quite unfortunately specified. /* XXX: The X Shape specification is quite unfortunately specified.
* *
@ -1914,7 +1914,7 @@ meta_window_x11_update_shape_region (MetaWindow *window)
unsigned w_bounding, h_bounding, w_clip, h_clip; unsigned w_bounding, h_bounding, w_clip, h_clip;
int bounding_shaped, clip_shaped; int bounding_shaped, clip_shaped;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XShapeQueryExtents (x11_display->xdisplay, window->xwindow, XShapeQueryExtents (x11_display->xdisplay, window->xwindow,
&bounding_shaped, &x_bounding, &y_bounding, &bounding_shaped, &x_bounding, &y_bounding,
&w_bounding, &h_bounding, &w_bounding, &h_bounding,
@ -1929,7 +1929,7 @@ meta_window_x11_update_shape_region (MetaWindow *window)
&n_rects, &n_rects,
&ordering); &ordering);
} }
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
if (rects) if (rects)
{ {
@ -2442,14 +2442,14 @@ meta_window_x11_client_message (MetaWindow *window,
char *str1; char *str1;
char *str2; char *str2;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str1 = XGetAtomName (x11_display->xdisplay, first); str1 = XGetAtomName (x11_display->xdisplay, first);
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
str1 = NULL; str1 = NULL;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
str2 = XGetAtomName (x11_display->xdisplay, second); str2 = XGetAtomName (x11_display->xdisplay, second);
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
str2 = NULL; str2 = NULL;
meta_verbose ("Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s\n", meta_verbose ("Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s\n",
@ -2863,12 +2863,12 @@ set_wm_state_on_xwindow (MetaDisplay *display,
data[0] = state; data[0] = state;
data[1] = None; data[1] = None;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
XChangeProperty (display->x11_display->xdisplay, xwindow, XChangeProperty (display->x11_display->xdisplay, xwindow,
display->x11_display->atom_WM_STATE, display->x11_display->atom_WM_STATE,
display->x11_display->atom_WM_STATE, display->x11_display->atom_WM_STATE,
32, PropModeReplace, (guchar*) data, 2); 32, PropModeReplace, (guchar*) data, 2);
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
} }
void void
@ -2921,7 +2921,7 @@ maybe_filter_xwindow (MetaDisplay *display,
filtered = TRUE; filtered = TRUE;
meta_error_trap_push (display->x11_display); meta_x11_error_trap_push (display->x11_display);
success = XGetClassHint (display->x11_display->xdisplay, success = XGetClassHint (display->x11_display->xdisplay,
xwindow, &class_hint); xwindow, &class_hint);
@ -2966,7 +2966,7 @@ maybe_filter_xwindow (MetaDisplay *display,
XUnmapWindow (display->x11_display->xdisplay, xwindow); XUnmapWindow (display->x11_display->xdisplay, xwindow);
} }
meta_error_trap_pop (display->x11_display); meta_x11_error_trap_pop (display->x11_display);
return filtered; return filtered;
} }
@ -3047,7 +3047,7 @@ meta_window_x11_new (MetaDisplay *display,
return NULL; return NULL;
} }
meta_error_trap_push (x11_display); /* Push a trap over all of window meta_x11_error_trap_push (x11_display); /* Push a trap over all of window
* creation, to reduce XSync() calls * creation, to reduce XSync() calls
*/ */
/* /*
@ -3118,7 +3118,7 @@ meta_window_x11_new (MetaDisplay *display,
*/ */
XAddToSaveSet (x11_display->xdisplay, xwindow); XAddToSaveSet (x11_display->xdisplay, xwindow);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
event_mask = PropertyChangeMask; event_mask = PropertyChangeMask;
if (attrs.override_redirect) if (attrs.override_redirect)
@ -3162,7 +3162,7 @@ meta_window_x11_new (MetaDisplay *display,
&set_attrs); &set_attrs);
} }
if (meta_error_trap_pop_with_return (x11_display) != Success) if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
{ {
meta_verbose ("Window 0x%lx disappeared just as we tried to manage it\n", meta_verbose ("Window 0x%lx disappeared just as we tried to manage it\n",
xwindow); xwindow);
@ -3189,11 +3189,11 @@ meta_window_x11_new (MetaDisplay *display,
meta_display_grab_focus_window_button (window->display, window); meta_display_grab_focus_window_button (window->display, window);
} }
meta_error_trap_pop (x11_display); /* pop the XSync()-reducing trap */ meta_x11_error_trap_pop (x11_display); /* pop the XSync()-reducing trap */
return window; return window;
error: error:
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
return NULL; return NULL;
} }
@ -3247,10 +3247,10 @@ meta_window_x11_recalc_window_type (MetaWindow *window)
*/ */
type = META_WINDOW_NORMAL; type = META_WINDOW_NORMAL;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
atom_name = XGetAtomName (x11_display->xdisplay, atom_name = XGetAtomName (x11_display->xdisplay,
priv->type_atom); priv->type_atom);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
meta_warning ("Unrecognized type atom [%s] set for %s \n", meta_warning ("Unrecognized type atom [%s] set for %s \n",
atom_name ? atom_name : "unknown", atom_name ? atom_name : "unknown",
@ -3413,12 +3413,12 @@ meta_window_x11_set_allowed_actions_hint (MetaWindow *window)
meta_verbose ("Setting _NET_WM_ALLOWED_ACTIONS with %d atoms\n", i); meta_verbose ("Setting _NET_WM_ALLOWED_ACTIONS with %d atoms\n", i);
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, window->xwindow, XChangeProperty (x11_display->xdisplay, window->xwindow,
x11_display->atom__NET_WM_ALLOWED_ACTIONS, x11_display->atom__NET_WM_ALLOWED_ACTIONS,
XA_ATOM, XA_ATOM,
32, PropModeReplace, (guchar*) data, i); 32, PropModeReplace, (guchar*) data, i);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
#undef MAX_N_ACTIONS #undef MAX_N_ACTIONS
} }
@ -3433,7 +3433,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
window->sync_request_alarm != None) window->sync_request_alarm != None)
return; return;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
/* In the new (extended style), the counter value is initialized by /* In the new (extended style), the counter value is initialized by
* the client before mapping the window. In the old style, we're * the client before mapping the window. In the old style, we're
@ -3445,7 +3445,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
window->sync_request_counter, window->sync_request_counter,
&init)) &init))
{ {
meta_error_trap_pop_with_return (x11_display); meta_x11_error_trap_pop_with_return (x11_display);
window->sync_request_counter = None; window->sync_request_counter = None;
return; return;
} }
@ -3484,7 +3484,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
XSyncCAEvents, XSyncCAEvents,
&values); &values);
if (meta_error_trap_pop_with_return (x11_display) == Success) if (meta_x11_error_trap_pop_with_return (x11_display) == Success)
meta_x11_display_register_sync_alarm (x11_display, &window->sync_request_alarm, window); meta_x11_display_register_sync_alarm (x11_display, &window->sync_request_alarm, window);
else else
{ {

View File

@ -84,7 +84,7 @@ from The Open Group.
#include <stdlib.h> #include <stdlib.h>
#include "xprops.h" #include "xprops.h"
#include <meta/errors.h> #include <meta/meta-x11-errors.h>
#include "util-private.h" #include "util-private.h"
#include "ui.h" #include "ui.h"
#include "mutter-Xatomtype.h" #include "mutter-Xatomtype.h"
@ -126,11 +126,11 @@ validate_or_free_results (GetPropertyResults *results,
(!must_have_items || results->n_items > 0)) (!must_have_items || results->n_items > 0))
return TRUE; return TRUE;
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
type_name = XGetAtomName (x11_display->xdisplay, results->type); type_name = XGetAtomName (x11_display->xdisplay, results->type);
expected_name = XGetAtomName (x11_display->xdisplay, expected_type); expected_name = XGetAtomName (x11_display->xdisplay, expected_type);
prop_name = XGetAtomName (x11_display->xdisplay, results->xatom); prop_name = XGetAtomName (x11_display->xdisplay, results->xatom);
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
w = meta_x11_display_lookup_x_window (x11_display, results->xwindow); w = meta_x11_display_lookup_x_window (x11_display, results->xwindow);
@ -464,9 +464,9 @@ utf8_list_from_results (GetPropertyResults *results,
{ {
char *name; char *name;
meta_error_trap_push (results->x11_display); meta_x11_error_trap_push (results->x11_display);
name = XGetAtomName (results->x11_display->xdisplay, results->xatom); name = XGetAtomName (results->x11_display->xdisplay, results->xatom);
meta_error_trap_pop (results->x11_display); meta_x11_error_trap_pop (results->x11_display);
meta_warning ("Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n", meta_warning ("Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n",
name, results->xwindow, i); name, results->xwindow, i);
meta_XFree (name); meta_XFree (name);
@ -518,12 +518,12 @@ meta_prop_set_utf8_string_hint (MetaX11Display *x11_display,
Atom atom, Atom atom,
const char *val) const char *val)
{ {
meta_error_trap_push (x11_display); meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, XChangeProperty (x11_display->xdisplay,
xwindow, atom, xwindow, atom,
x11_display->atom_UTF8_STRING, x11_display->atom_UTF8_STRING,
8, PropModeReplace, (guchar*) val, strlen (val)); 8, PropModeReplace, (guchar*) val, strlen (val));
meta_error_trap_pop (x11_display); meta_x11_error_trap_pop (x11_display);
} }
static gboolean static gboolean