From 25c9ce2dad5a7e4c9b1414ca3f502ac7733a42b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20Krezovi=C4=87?= Date: Sun, 27 Aug 2017 20:48:55 +0200 Subject: [PATCH] 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 --- po/POTFILES.in | 2 +- src/Makefile.am | 6 +- src/backends/meta-cursor-tracker.c | 2 +- src/backends/meta-cursor.c | 2 +- src/backends/meta-monitor-manager.c | 2 +- .../native/meta-monitor-manager-kms.c | 2 +- src/backends/x11/meta-input-settings-x11.c | 10 +- .../x11/meta-monitor-manager-xrandr.c | 2 +- src/compositor/compositor.c | 10 +- src/compositor/meta-background-actor.c | 2 +- src/compositor/meta-plugin-manager.c | 2 +- src/compositor/meta-surface-actor-x11.c | 22 ++--- src/compositor/meta-window-actor.c | 10 +- src/core/core.c | 2 +- src/core/delete.c | 2 +- src/core/display.c | 2 +- src/core/frame.c | 10 +- src/core/keybindings.c | 6 +- src/core/main.c | 2 +- src/core/stack-tracker.c | 10 +- src/core/stack.c | 2 +- src/core/startup-notification.c | 6 +- src/core/window.c | 14 +-- src/core/workspace.c | 2 +- src/meta/{errors.h => meta-x11-errors.h} | 6 +- src/wayland/meta-window-wayland.c | 6 +- src/wayland/meta-xwayland-selection.c | 6 +- src/x11/events.c | 46 ++++----- src/x11/iconcache.c | 14 +-- src/x11/meta-x11-display.c | 46 ++++----- src/{core/errors.c => x11/meta-x11-errors.c} | 8 +- src/x11/window-props.c | 6 +- src/x11/window-x11.c | 94 +++++++++---------- src/x11/xprops.c | 14 +-- 34 files changed, 189 insertions(+), 189 deletions(-) rename src/meta/{errors.h => meta-x11-errors.h} (82%) rename src/{core/errors.c => x11/meta-x11-errors.c} (90%) diff --git a/po/POTFILES.in b/po/POTFILES.in index 6e05468c1..8685fcae0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -13,7 +13,6 @@ src/compositor/meta-background.c src/core/bell.c src/core/core.c src/core/display.c -src/core/errors.c src/core/keybindings.c src/core/main.c src/core/meta-close-dialog-default.c @@ -25,6 +24,7 @@ src/ui/frames.c src/ui/theme.c src/wayland/meta-wayland-tablet-pad.c src/x11/meta-x11-display.c +src/x11/meta-x11-errors.c src/x11/session.c src/x11/window-props.c src/x11/xprops.c diff --git a/src/Makefile.am b/src/Makefile.am index 0a0d5a08b..ce86ef04e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -247,8 +247,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \ core/edge-resistance.h \ core/events.c \ core/events.h \ - core/errors.c \ - meta/errors.h \ core/frame.c \ core/frame.h \ core/meta-gesture-tracker.c \ @@ -290,6 +288,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \ x11/meta-x11-display.c \ x11/meta-x11-display-private.h \ meta/meta-x11-display.h \ + x11/meta-x11-errors.c \ + meta/meta-x11-errors.h \ x11/events.c \ x11/events.h \ x11/group-private.h \ @@ -449,7 +449,6 @@ libmutterinclude_headers = \ meta/compositor-mutter.h \ meta/compositor.h \ meta/display.h \ - meta/errors.h \ meta/group.h \ meta/keybindings.h \ meta/main.h \ @@ -471,6 +470,7 @@ libmutterinclude_headers = \ meta/meta-window-actor.h \ meta/meta-window-shape.h \ meta/meta-x11-display.h \ + meta/meta-x11-errors.h \ meta/prefs.h \ meta/theme.h \ meta/types.h \ diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index 72509e630..9cbd3dff5 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c index 421825c56..0b8c4dbb1 100644 --- a/src/backends/meta-cursor.c +++ b/src/backends/meta-cursor.c @@ -23,7 +23,7 @@ #include "meta-cursor.h" -#include +#include #include "display-private.h" #include "meta-backend-private.h" diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 95b915808..8573979eb 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -34,7 +34,7 @@ #include #include "util-private.h" -#include +#include #include "edid.h" #include "backends/meta-logical-monitor.h" #include "backends/meta-monitor.h" diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c index 1105dc5c5..36764d118 100644 --- a/src/backends/native/meta-monitor-manager-kms.c +++ b/src/backends/native/meta-monitor-manager-kms.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c index 42000ca02..cf64cccae 100644 --- a/src/backends/x11/meta-input-settings-x11.c +++ b/src/backends/x11/meta-input-settings-x11.c @@ -35,7 +35,7 @@ #include #endif -#include +#include #include "backends/meta-logical-monitor.h" typedef struct _MetaInputSettingsX11Private @@ -547,7 +547,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings, return; /* Grab the puke bucket! */ - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); xdev = XOpenDevice (xdisplay, device_id); if (xdev) { @@ -557,7 +557,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings, XCloseDevice (xdisplay, xdev); } - 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", clutter_input_device_get_device_name (device)); @@ -744,7 +744,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti return; /* Grab the puke bucket! */ - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); xdev = XOpenDevice (xdisplay, device_id); if (xdev) { @@ -758,7 +758,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti XCloseDevice (xdisplay, xdev); } - 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", clutter_input_device_get_device_name (device)); diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 73842648f..0087c4718 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -42,7 +42,7 @@ #include "meta-backend-x11.h" #include -#include +#include #include "backends/meta-monitor-config-manager.h" #include "backends/meta-logical-monitor.h" diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index e3b47cad8..bc9a2de06 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -55,7 +55,7 @@ #include #include "core.h" -#include +#include #include #include "compositor-private.h" #include @@ -462,11 +462,11 @@ redirect_windows (MetaX11Display *x11_display) */ while (TRUE) { - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual); XSync (xdisplay, FALSE); - if (!meta_error_trap_pop_with_return (x11_display)) + if (!meta_x11_error_trap_pop_with_return (x11_display)) break; if (n_retries == max_retries) @@ -658,12 +658,12 @@ meta_compositor_add_window (MetaCompositor *compositor, { MetaDisplay *display = compositor->display; - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); meta_window_actor_new (window); sync_actor_stacking (compositor); - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } void diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c index bdd60d247..41388711d 100644 --- a/src/compositor/meta-background-actor.c +++ b/src/compositor/meta-background-actor.c @@ -78,7 +78,7 @@ #include "cogl-utils.h" #include "clutter-utils.h" -#include +#include #include "meta-background-actor-private.h" #include "meta-background-private.h" #include "meta-cullable.h" diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c index 834f678dd..0b6f216d0 100644 --- a/src/compositor/meta-plugin-manager.c +++ b/src/compositor/meta-plugin-manager.c @@ -23,7 +23,7 @@ #include "compositor-private.h" #include "meta-plugin-manager.h" #include -#include +#include #include #include "meta-module.h" #include "window-private.h" diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c index b4ef019bb..3b66ed5aa 100644 --- a/src/compositor/meta-surface-actor-x11.c +++ b/src/compositor/meta-surface-actor-x11.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include "window-private.h" #include "meta-shaped-texture-private.h" #include "meta-cullable.h" @@ -74,10 +74,10 @@ free_damage (MetaSurfaceActorX11 *self) if (priv->damage == None) return; - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); XDamageDestroy (xdisplay, priv->damage); priv->damage = None; - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } static void @@ -98,10 +98,10 @@ detach_pixmap (MetaSurfaceActorX11 *self) meta_shaped_texture_set_texture (stex, NULL); cogl_flush (); - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); XFreePixmap (xdisplay, priv->pixmap); 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); } @@ -152,10 +152,10 @@ update_pixmap (MetaSurfaceActorX11 *self) Pixmap new_pixmap; 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); - 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 * GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync @@ -228,9 +228,9 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor) 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); - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); priv->received_damage = FALSE; } @@ -315,7 +315,7 @@ sync_unredirected (MetaSurfaceActorX11 *self) Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display); 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) { @@ -327,7 +327,7 @@ sync_unredirected (MetaSurfaceActorX11 *self) XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual); } - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } static void diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index ddf539fc9..045e46265 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include "frame.h" #include #include @@ -1963,10 +1963,10 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame) ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff); 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); XFlush (xdisplay); - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } void @@ -2040,10 +2040,10 @@ do_send_frame_timings (MetaWindowActor *self, ev.data.l[3] = refresh_interval; 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); XFlush (xdisplay); - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } static void diff --git a/src/core/core.c b/src/core/core.c index fa702e16f..8aeebe505 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -26,7 +26,7 @@ #include "frame.h" #include "workspace-private.h" #include -#include +#include #include "util-private.h" #include "x11/meta-x11-display-private.h" diff --git a/src/core/delete.c b/src/core/delete.c index af7cffed9..4e3c9b629 100644 --- a/src/core/delete.c +++ b/src/core/delete.c @@ -26,7 +26,7 @@ #include "util-private.h" #include "window-private.h" #include "compositor-private.h" -#include +#include #include #include diff --git a/src/core/display.c b/src/core/display.c index 79d7689c4..7673956d9 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -39,7 +39,7 @@ #include "window-private.h" #include "boxes-private.h" #include "frame.h" -#include +#include #include "keybindings-private.h" #include #include "workspace-private.h" diff --git a/src/core/frame.c b/src/core/frame.c index e647644dd..dc0109208 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -24,7 +24,7 @@ #include #include "frame.h" #include "bell.h" -#include +#include #include "keybindings-private.h" #include "backends/x11/meta-backend-x11.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_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); if (window->mapped) { window->mapped = FALSE; /* the reparent will unmap the window, @@ -107,7 +107,7 @@ meta_window_ensure_frame (MetaWindow *window) frame->child_x, frame->child_y); /* FIXME handle this error */ - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); /* stick frame to the window */ window->frame = frame; @@ -174,7 +174,7 @@ meta_window_destroy_frame (MetaWindow *window) /* Unparent the client window; it may be destroyed, * thus the error trap. */ - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); if (window->mapped) { 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.y + borders.invisible.top); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); meta_ui_frame_unmanage (frame->ui_frame); diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 5e1d9723c..0f4e7440d 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -31,7 +31,7 @@ #include "keybindings-private.h" #include "workspace-private.h" #include -#include +#include #include "edge-resistance.h" #include "frame.h" #include @@ -2838,7 +2838,7 @@ handle_panel (MetaDisplay *display, "off due to keybinding press\n", event->time); 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 */ XUngrabKeyboard (x11_display->xdisplay, event->time); @@ -2849,7 +2849,7 @@ handle_panel (MetaDisplay *display, StructureNotifyMask, (XEvent*) &ev); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void diff --git a/src/core/main.c b/src/core/main.c index 82fcf75ca..04d63ee0e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -47,7 +47,7 @@ #include #include "util-private.h" #include "display-private.h" -#include +#include #include "ui.h" #include #include diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c index 0b3379b20..ec44b61b2 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -39,7 +39,7 @@ #include "frame.h" #include "display-private.h" #include "stack-tracker.h" -#include +#include #include #include @@ -1001,7 +1001,7 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker, { 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; @@ -1010,7 +1010,7 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker, (changes.sibling ? CWSibling : 0) | CWStackMode, &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); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); changes.stack_mode = changes.sibling ? Above : Below; @@ -1045,7 +1045,7 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker, (changes.sibling ? CWSibling : 0) | CWStackMode, &changes); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } } diff --git a/src/core/stack.c b/src/core/stack.c index 6118f16e5..dffce9ad5 100644 --- a/src/core/stack.c +++ b/src/core/stack.c @@ -28,7 +28,7 @@ #include #include "stack.h" #include "window-private.h" -#include +#include #include "frame.h" #include #include diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c index cde784573..710562bd0 100644 --- a/src/core/startup-notification.c +++ b/src/core/startup-notification.c @@ -26,7 +26,7 @@ #include -#include +#include #include "display-private.h" #include "x11/meta-x11-display-private.h" #include "startup-notification-private.h" @@ -584,7 +584,7 @@ sn_error_trap_push (SnDisplay *sn_display, MetaDisplay *display; display = meta_display_for_x_display (xdisplay); if (display != NULL) - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); } static void @@ -594,7 +594,7 @@ sn_error_trap_pop (SnDisplay *sn_display, MetaDisplay *display; display = meta_display_for_x_display (xdisplay); if (display != NULL) - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } static void diff --git a/src/core/window.c b/src/core/window.c index 274ce39db..5662f6689 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -32,7 +32,7 @@ #include "edge-resistance.h" #include "util-private.h" #include "frame.h" -#include +#include #include "workspace-private.h" #include "stack.h" #include "keybindings-private.h" @@ -754,7 +754,7 @@ sync_client_window_mapped (MetaWindow *window) 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) { XMapWindow (window->display->x11_display->xdisplay, window->xwindow); @@ -764,7 +764,7 @@ sync_client_window_mapped (MetaWindow *window) XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow); window->unmaps_pending ++; } - meta_error_trap_pop (window->display->x11_display); + meta_x11_error_trap_pop (window->display->x11_display); } static void @@ -6467,7 +6467,7 @@ warp_grab_pointer (MetaWindow *window, *x = CLAMP (*x, 0, display_rect.width-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, "Warping pointer to %d,%d with window at %d,%d\n", @@ -6489,7 +6489,7 @@ warp_grab_pointer (MetaWindow *window, 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", window->desc); @@ -7679,14 +7679,14 @@ window_has_pointer_x11 (MetaWindow *window) XIModifierState mods; XIGroupState group; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XIQueryPointer (x11_display->xdisplay, META_VIRTUAL_CORE_POINTER_ID, x11_display->xroot, &root, &child, &root_x, &root_y, &x, &y, &buttons, &mods, &group); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); free (buttons.mask); return meta_x11_display_lookup_x_window (x11_display, child) == window; diff --git a/src/core/workspace.c b/src/core/workspace.c index 116862dc3..390ae2573 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -38,7 +38,7 @@ #include #include "workspace-private.h" #include "boxes-private.h" -#include +#include #include #include diff --git a/src/meta/errors.h b/src/meta/meta-x11-errors.h similarity index 82% rename from src/meta/errors.h rename to src/meta/meta-x11-errors.h index 7c08febc4..517e169b3 100644 --- a/src/meta/errors.h +++ b/src/meta/meta-x11-errors.h @@ -27,11 +27,11 @@ #include #include -void meta_error_trap_push (MetaX11Display *x11_display); -void meta_error_trap_pop (MetaX11Display *x11_display); +void meta_x11_error_trap_push (MetaX11Display *x11_display); +void meta_x11_error_trap_pop (MetaX11Display *x11_display); /* 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 diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index 52e3ab58e..de192f785 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -26,7 +26,7 @@ #include "meta-window-wayland.h" -#include +#include #include #include /* for strerror () */ #include "window-private.h" @@ -584,7 +584,7 @@ meta_window_wayland_new (MetaDisplay *display, * 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... */ - 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 */ @@ -597,7 +597,7 @@ meta_window_wayland_new (MetaDisplay *display, &attrs); 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; } diff --git a/src/wayland/meta-xwayland-selection.c b/src/wayland/meta-xwayland-selection.c index 7c5b7d03c..05975c51c 100644 --- a/src/wayland/meta-xwayland-selection.c +++ b/src/wayland/meta-xwayland-selection.c @@ -34,7 +34,7 @@ #include #include -#include +#include #include "meta-xwayland.h" #include "meta-xwayland-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! */ 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 ()), data->request_event.requestor, NoEventMask); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } g_cancellable_cancel (data->cancellable); diff --git a/src/x11/events.c b/src/x11/events.c index 350c16189..d45c4b35f 100644 --- a/src/x11/events.c +++ b/src/x11/events.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include "meta/meta-backend.h" #include "bell.h" #include "display-private.h" @@ -537,10 +537,10 @@ meta_spew_core_event (MetaX11Display *x11_display, name = "PropertyNotify"; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); str = XGetAtomName (x11_display->xdisplay, event->xproperty.atom); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); if (event->xproperty.state == PropertyNewValue) state = "PropertyNewValue"; @@ -571,10 +571,10 @@ meta_spew_core_event (MetaX11Display *x11_display, { char *str; name = "ClientMessage"; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); str = XGetAtomName (x11_display->xdisplay, 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", str ? str : "(unknown atom)", event->xclient.format); @@ -978,12 +978,12 @@ process_request_frame_extents (MetaX11Display *x11_display, "to top = %lu, left = %lu, bottom = %lu, right = %lu\n", 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, x11_display->atom__NET_FRAME_EXTENTS, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 4); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); meta_XFree (hints); } @@ -1004,7 +1004,7 @@ convert_property (MetaX11Display *x11_display, conversion_targets[2] = x11_display->atom_TIMESTAMP; 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) XChangeProperty (x11_display->xdisplay, w, property, XA_ATOM, 32, PropModeReplace, @@ -1019,11 +1019,11 @@ convert_property (MetaX11Display *x11_display, (unsigned char *)icccm_version, 2); else { - meta_error_trap_pop_with_return (x11_display); + meta_x11_error_trap_pop_with_return (x11_display); 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; /* Be sure the PropertyNotify has arrived so we @@ -1048,10 +1048,10 @@ process_selection_request (MetaX11Display *x11_display, { char *str; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); str = XGetAtomName (x11_display->xdisplay, 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", str ? str : "(bad atom)", event->xselectionrequest.owner); @@ -1078,18 +1078,18 @@ process_selection_request (MetaX11Display *x11_display, unsigned long num, rest; unsigned char *data; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); if (XGetWindowProperty (x11_display->xdisplay, event->xselectionrequest.requestor, event->xselectionrequest.property, 0, 256, False, x11_display->atom_ATOM_PAIR, &type, &format, &num, &rest, &data) != Success) { - meta_error_trap_pop_with_return (x11_display); + meta_x11_error_trap_pop_with_return (x11_display); 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, * but since we have 4 possible targets, we will hardly ever @@ -1106,13 +1106,13 @@ process_selection_request (MetaX11Display *x11_display, i += 2; } - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, event->xselectionrequest.requestor, event->xselectionrequest.property, x11_display->atom_ATOM_PAIR, 32, PropModeReplace, data, num); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); meta_XFree (data); } } @@ -1145,10 +1145,10 @@ process_selection_clear (MetaX11Display *x11_display, { char *str; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); str = XGetAtomName (x11_display->xdisplay, 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", 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", window->frame->xwindow); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); meta_window_destroy_frame (window->frame->window); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } 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", 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, xwcm, &xwc); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } else { diff --git a/src/x11/iconcache.c b/src/x11/iconcache.c index 7c9cf5225..07004d949 100644 --- a/src/x11/iconcache.c +++ b/src/x11/iconcache.c @@ -24,7 +24,7 @@ #include "x11/meta-x11-display-private.h" #include "iconcache.h" -#include +#include #include #include @@ -210,7 +210,7 @@ read_rgb_icon (MetaX11Display *x11_display, int mini_w, mini_h; gulong *data_as_long; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); type = None; data = NULL; result = XGetWindowProperty (x11_display->xdisplay, @@ -219,7 +219,7 @@ read_rgb_icon (MetaX11Display *x11_display, 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, &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 || result != Success) @@ -340,7 +340,7 @@ try_pixmap_and_mask (MetaX11Display *x11_display, if (src_pixmap == None) 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); 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); } - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); if (icon && mask) { @@ -404,7 +404,7 @@ get_kwm_win_icon (MetaX11Display *x11_display, *pixmap = None; *mask = None; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); icons = NULL; result = XGetWindowProperty (x11_display->xdisplay, xwindow, x11_display->atom__KWM_WIN_ICON, @@ -415,7 +415,7 @@ get_kwm_win_icon (MetaX11Display *x11_display, &bytes_after, &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 || result != Success) return; diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 795f48676..6a3b792a8 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -57,8 +57,8 @@ #include "core/frame.h" #include "core/util-private.h" #include "core/workspace-private.h" -#include "meta/errors.h" #include "meta/main.h" +#include "meta/meta-x11-errors.h" #include "x11/events.h" #include "x11/group-props.h" @@ -177,9 +177,9 @@ meta_x11_display_dispose (GObject *object) if (x11_display->xroot != None) { - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); 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", DefaultScreen (x11_display->xdisplay), x11_display->name); @@ -513,13 +513,13 @@ set_desktop_geometry_hint (MetaX11Display *x11_display) 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, x11_display->xroot, x11_display->atom__NET_DESKTOP_GEOMETRY, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 2); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -538,13 +538,13 @@ set_desktop_viewport_hint (MetaX11Display *x11_display) 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, x11_display->xroot, x11_display->atom__NET_DESKTOP_VIEWPORT, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 2); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static int @@ -645,10 +645,10 @@ take_manager_selection (MetaX11Display *x11_display, if (should_replace) { /* 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; 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 */ } else @@ -805,13 +805,13 @@ set_active_workspace_hint (MetaDisplay *display, 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, x11_display->xroot, x11_display->atom__NET_CURRENT_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 1); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -829,13 +829,13 @@ set_number_of_spaces_hint (MetaDisplay *display, 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, x11_display->xroot, x11_display->atom__NET_NUMBER_OF_DESKTOPS, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 1); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -846,13 +846,13 @@ set_showing_desktop_hint (MetaDisplay *display, 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, x11_display->xroot, x11_display->atom__NET_SHOWING_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 1); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -881,14 +881,14 @@ set_workspace_names (MetaX11Display *x11_display) ++i; } - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, x11_display->xroot, x11_display->atom__NET_DESKTOP_NAMES, x11_display->atom_UTF8_STRING, 8, PropModeReplace, (unsigned char *)flattened->str, flattened->len); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); g_string_free (flattened, TRUE); } @@ -919,13 +919,13 @@ set_work_area_hint (MetaDisplay *display, tmp += 4; } - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, x11_display->xroot, x11_display->atom__NET_WORKAREA, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, num_workspaces*4); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); g_free (data); } @@ -1746,13 +1746,13 @@ meta_x11_display_update_active_window_hint (MetaX11Display *x11_display) else data[0] = None; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, x11_display->xroot, x11_display->atom__NET_ACTIVE_WINDOW, XA_WINDOW, 32, PropModeReplace, (guchar*) data, 1); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -1766,7 +1766,7 @@ request_xserver_input_focus_change (MetaX11Display *x11_display, if (meta_display_timestamp_too_old (x11_display->display, ×tamp)) 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 * the serial of the "focus request" we made, but if we take the serial @@ -1799,7 +1799,7 @@ request_xserver_input_focus_change (MetaX11Display *x11_display, serial, TRUE); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); x11_display->display->last_focus_time = timestamp; diff --git a/src/core/errors.c b/src/x11/meta-x11-errors.c similarity index 90% rename from src/core/errors.c rename to src/x11/meta-x11-errors.c index fb01c9a1d..d40b864dc 100644 --- a/src/core/errors.c +++ b/src/x11/meta-x11-errors.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include @@ -44,19 +44,19 @@ */ 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); } 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); } 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); } diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 5f8ee647c..946568cb2 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -41,7 +41,7 @@ #include "window-x11.h" #include "window-x11-private.h" #include "x11/meta-x11-display-private.h" -#include +#include #include "xprops.h" #include "frame.h" #include @@ -576,11 +576,11 @@ set_title_text (MetaWindow *window, /* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */ 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, window->xwindow, atom); - meta_error_trap_pop (window->display->x11_display); + meta_x11_error_trap_pop (window->display->x11_display); } return modified; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 343ce2e26..1062d9480 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -39,7 +39,7 @@ #include "core.h" #include -#include +#include #include #include @@ -98,10 +98,10 @@ send_icccm_message (MetaWindow *window, ev.data.l[0] = atom; ev.data.l[1] = timestamp; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XSendEvent (x11_display->xdisplay, window->xwindow, False, 0, (XEvent*) &ev); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static Window @@ -255,11 +255,11 @@ send_configure_notify (MetaWindow *window) event.xconfigure.x, event.xconfigure.y, event.xconfigure.width, event.xconfigure.height); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XSendEvent (x11_display->xdisplay, window->xwindow, False, StructureNotifyMask, &event); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -583,7 +583,7 @@ meta_window_x11_unmanage (MetaWindow *window) MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); 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); @@ -663,7 +663,7 @@ meta_window_x11_unmanage (MetaWindow *window) meta_display_ungrab_window_buttons (window->display, window->xwindow); 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) { @@ -692,7 +692,7 @@ meta_window_x11_delete (MetaWindow *window, { MetaX11Display *x11_display = window->display->x11_display; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); if (window->delete_window) { meta_topic (META_DEBUG_WINDOW_OPS, @@ -707,7 +707,7 @@ meta_window_x11_delete (MetaWindow *window, window->desc); XKillClient (x11_display->xdisplay, window->xwindow); } - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -719,9 +719,9 @@ meta_window_x11_kill (MetaWindow *window) "Disconnecting %s with XKillClient()\n", window->desc); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XKillClient (x11_display->xdisplay, window->xwindow); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -905,12 +905,12 @@ update_net_frame_extents (MetaWindow *window) "to left = %lu, right = %lu, top = %lu, bottom = %lu\n", 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, x11_display->atom__NET_FRAME_EXTENTS, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 4); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static gboolean @@ -1025,12 +1025,12 @@ meta_window_x11_current_workspace_changed (MetaWindow *window) meta_verbose ("Setting _NET_WM_DESKTOP of %s to %lu\n", window->desc, data[0]); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, window->xwindow, x11_display->atom__NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 1); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static void @@ -1232,7 +1232,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window, 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 && meta_grab_op_is_resizing (window->display->grab_op) && @@ -1249,7 +1249,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window, mask, &values); - meta_error_trap_pop (window->display->x11_display); + meta_x11_error_trap_pop (window->display->x11_display); } if (!configure_frame_first && window->frame) @@ -1642,12 +1642,12 @@ meta_window_x11_set_net_wm_state (MetaWindow *window) 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, x11_display->atom__NET_WM_STATE, XA_ATOM, 32, PropModeReplace, (guchar*) data, i); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); if (window->fullscreen) { @@ -1667,22 +1667,22 @@ meta_window_x11_set_net_wm_state (MetaWindow *window) window->fullscreen_monitors.right); 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, window->xwindow, x11_display->atom__NET_WM_FULLSCREEN_MONITORS, XA_CARDINAL, 32, PropModeReplace, (guchar*) data, 4); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } else { 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, window->xwindow, x11_display->atom__NET_WM_FULLSCREEN_MONITORS); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } } } @@ -1767,13 +1767,13 @@ meta_window_x11_update_input_region (MetaWindow *window) XRectangle *rects = NULL; int n_rects = -1, ordering; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); rects = XShapeGetRectangles (x11_display->xdisplay, window->xwindow, ShapeInput, &n_rects, &ordering); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); /* XXX: The X Shape specification is quite unfortunately specified. * @@ -1874,7 +1874,7 @@ meta_window_x11_update_shape_region (MetaWindow *window) unsigned w_bounding, h_bounding, w_clip, h_clip; int bounding_shaped, clip_shaped; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XShapeQueryExtents (x11_display->xdisplay, window->xwindow, &bounding_shaped, &x_bounding, &y_bounding, &w_bounding, &h_bounding, @@ -1889,7 +1889,7 @@ meta_window_x11_update_shape_region (MetaWindow *window) &n_rects, &ordering); } - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); if (rects) { @@ -2346,14 +2346,14 @@ meta_window_x11_client_message (MetaWindow *window, char *str1; char *str2; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); 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; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); 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; meta_verbose ("Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s\n", @@ -2762,12 +2762,12 @@ set_wm_state_on_xwindow (MetaDisplay *display, data[0] = state; data[1] = None; - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); XChangeProperty (display->x11_display->xdisplay, xwindow, display->x11_display->atom_WM_STATE, display->x11_display->atom_WM_STATE, 32, PropModeReplace, (guchar*) data, 2); - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); } void @@ -2820,7 +2820,7 @@ maybe_filter_xwindow (MetaDisplay *display, filtered = TRUE; - meta_error_trap_push (display->x11_display); + meta_x11_error_trap_push (display->x11_display); success = XGetClassHint (display->x11_display->xdisplay, xwindow, &class_hint); @@ -2865,7 +2865,7 @@ maybe_filter_xwindow (MetaDisplay *display, XUnmapWindow (display->x11_display->xdisplay, xwindow); } - meta_error_trap_pop (display->x11_display); + meta_x11_error_trap_pop (display->x11_display); return filtered; } @@ -2946,7 +2946,7 @@ meta_window_x11_new (MetaDisplay *display, 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 */ /* @@ -3011,7 +3011,7 @@ meta_window_x11_new (MetaDisplay *display, */ XAddToSaveSet (x11_display->xdisplay, xwindow); - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); event_mask = PropertyChangeMask; if (attrs.override_redirect) @@ -3055,7 +3055,7 @@ meta_window_x11_new (MetaDisplay *display, &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", xwindow); @@ -3082,11 +3082,11 @@ meta_window_x11_new (MetaDisplay *display, 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; error: - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); return NULL; } @@ -3140,10 +3140,10 @@ meta_window_x11_recalc_window_type (MetaWindow *window) */ type = META_WINDOW_NORMAL; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); atom_name = XGetAtomName (x11_display->xdisplay, 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", atom_name ? atom_name : "unknown", @@ -3306,12 +3306,12 @@ meta_window_x11_set_allowed_actions_hint (MetaWindow *window) 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, x11_display->atom__NET_WM_ALLOWED_ACTIONS, XA_ATOM, 32, PropModeReplace, (guchar*) data, i); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); #undef MAX_N_ACTIONS } @@ -3326,7 +3326,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window) window->sync_request_alarm != None) 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 * the client before mapping the window. In the old style, we're @@ -3338,7 +3338,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window) window->sync_request_counter, &init)) { - meta_error_trap_pop_with_return (x11_display); + meta_x11_error_trap_pop_with_return (x11_display); window->sync_request_counter = None; return; } @@ -3377,7 +3377,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window) XSyncCAEvents, &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); else { diff --git a/src/x11/xprops.c b/src/x11/xprops.c index db42386dc..ae05afe14 100644 --- a/src/x11/xprops.c +++ b/src/x11/xprops.c @@ -84,7 +84,7 @@ from The Open Group. #include #include "xprops.h" -#include +#include #include "util-private.h" #include "ui.h" #include "mutter-Xatomtype.h" @@ -126,11 +126,11 @@ validate_or_free_results (GetPropertyResults *results, (!must_have_items || results->n_items > 0)) return TRUE; - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); type_name = XGetAtomName (x11_display->xdisplay, results->type); expected_name = XGetAtomName (x11_display->xdisplay, expected_type); 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); @@ -464,9 +464,9 @@ utf8_list_from_results (GetPropertyResults *results, { 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); - 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", name, results->xwindow, i); meta_XFree (name); @@ -518,12 +518,12 @@ meta_prop_set_utf8_string_hint (MetaX11Display *x11_display, Atom atom, const char *val) { - meta_error_trap_push (x11_display); + meta_x11_error_trap_push (x11_display); XChangeProperty (x11_display->xdisplay, xwindow, atom, x11_display->atom_UTF8_STRING, 8, PropModeReplace, (guchar*) val, strlen (val)); - meta_error_trap_pop (x11_display); + meta_x11_error_trap_pop (x11_display); } static gboolean