Skip to content

Commit 4940310

Browse files
committed
'meta_error_trap_push' instead 'meta_error_trap_push_with_return'
both functions have the same code
1 parent b4dcd38 commit 4940310

File tree

9 files changed

+22
-31
lines changed

9 files changed

+22
-31
lines changed

src/core/display.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
34053405

34063406
if (change_pointer)
34073407
{
3408-
meta_error_trap_push_with_return (display);
3408+
meta_error_trap_push (display);
34093409
XChangeActivePointerGrab (display->xdisplay,
34103410
GRAB_MASK,
34113411
cursor,
@@ -3617,7 +3617,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
36173617
XSyncAlarmAttributes values;
36183618
XSyncValue init;
36193619

3620-
meta_error_trap_push_with_return (display);
3620+
meta_error_trap_push (display);
36213621

36223622
/* Set the counter to 0, so we know that the application's
36233623
* responses to the client messages will always trigger
@@ -3934,7 +3934,7 @@ meta_change_button_grab (MetaDisplay *display,
39343934
}
39353935

39363936
if (meta_is_debugging ())
3937-
meta_error_trap_push_with_return (display);
3937+
meta_error_trap_push (display);
39383938

39393939
/* GrabModeSync means freeze until XAllowEvents */
39403940

@@ -4877,7 +4877,7 @@ convert_property (MetaDisplay *display,
48774877
conversion_targets[2] = display->atom_TIMESTAMP;
48784878
conversion_targets[3] = display->atom_VERSION;
48794879

4880-
meta_error_trap_push_with_return (display);
4880+
meta_error_trap_push (display);
48814881
if (target == display->atom_TARGETS)
48824882
XChangeProperty (display->xdisplay, w, property,
48834883
XA_ATOM, 32, PropModeReplace,
@@ -4955,7 +4955,7 @@ process_selection_request (MetaDisplay *display,
49554955
unsigned long num, rest;
49564956
unsigned char *data;
49574957

4958-
meta_error_trap_push_with_return (display);
4958+
meta_error_trap_push (display);
49594959
if (XGetWindowProperty (display->xdisplay,
49604960
event->xselectionrequest.requestor,
49614961
event->xselectionrequest.property, 0, 256, False,

src/core/errors.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ meta_error_trap_pop (MetaDisplay *display,
4444
gdk_x11_display_error_trap_pop_ignored (gdk_x11_lookup_xdisplay (meta_display_get_xdisplay (display)));
4545
}
4646

47-
void
48-
meta_error_trap_push_with_return (MetaDisplay *display)
49-
{
50-
gdk_x11_display_error_trap_push (gdk_x11_lookup_xdisplay (meta_display_get_xdisplay (display)));
51-
}
52-
5347
int
5448
meta_error_trap_pop_with_return (MetaDisplay *display,
5549
gboolean last_request_was_roundtrip)

src/core/iconcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ read_rgb_icon (MetaDisplay *display,
232232
int mini_w, mini_h;
233233
gulong *data_as_long;
234234

235-
meta_error_trap_push_with_return (display);
235+
meta_error_trap_push (display);
236236
type = None;
237237
data = NULL;
238238
result = XGetWindowProperty (display->xdisplay,
@@ -473,7 +473,7 @@ get_kwm_win_icon (MetaDisplay *display,
473473
*pixmap = None;
474474
*mask = None;
475475

476-
meta_error_trap_push_with_return (display);
476+
meta_error_trap_push (display);
477477
icons = NULL;
478478
result = XGetWindowProperty (display->xdisplay, xwindow,
479479
display->atom__KWM_WIN_ICON,

src/core/keybindings.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ meta_change_keygrab (MetaDisplay *display,
698698
}
699699

700700
if (meta_is_debugging ())
701-
meta_error_trap_push_with_return (display);
701+
meta_error_trap_push (display);
702+
702703
if (grab)
703704
XGrabKey (display->xdisplay, keycode,
704705
modmask | ignored_mask,
@@ -779,10 +780,7 @@ static void
779780
ungrab_all_keys (MetaDisplay *display,
780781
Window xwindow)
781782
{
782-
if (meta_is_debugging ())
783-
meta_error_trap_push_with_return (display);
784-
else
785-
meta_error_trap_push (display);
783+
meta_error_trap_push (display);
786784

787785
XUngrabKey (display->xdisplay, AnyKey, AnyModifier,
788786
xwindow);
@@ -913,7 +911,7 @@ grab_keyboard (MetaDisplay *display,
913911
/* Grab the keyboard, so we get key releases and all key
914912
* presses
915913
*/
916-
meta_error_trap_push_with_return (display);
914+
meta_error_trap_push (display);
917915

918916
grab_status = XGrabKeyboard (display->xdisplay,
919917
xwindow, True,

src/core/screen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ meta_screen_new (MetaDisplay *display,
379379
}
380380

381381
/* We want to find out when the current selection owner dies */
382-
meta_error_trap_push_with_return (display);
382+
meta_error_trap_push (display);
383383
attrs.event_mask = StructureNotifyMask;
384384
XChangeWindowAttributes (xdisplay,
385385
current_wm_sn_owner, CWEventMask, &attrs);
@@ -438,7 +438,7 @@ meta_screen_new (MetaDisplay *display,
438438
}
439439

440440
/* select our root window events */
441-
meta_error_trap_push_with_return (display);
441+
meta_error_trap_push (display);
442442

443443
/* We need to or with the existing event mask since
444444
* gtk+ may be interested in other events.
@@ -669,7 +669,7 @@ meta_screen_free (MetaScreen *screen,
669669

670670
meta_stack_free (screen->stack);
671671

672-
meta_error_trap_push_with_return (screen->display);
672+
meta_error_trap_push (screen->display);
673673
XSelectInput (screen->display->xdisplay, screen->xroot, 0);
674674
if (meta_error_trap_pop_with_return (screen->display, FALSE) != Success)
675675
meta_warning (_("Could not release screen %d on display \"%s\"\n"),
@@ -735,7 +735,7 @@ list_windows (MetaScreen *screen)
735735
{
736736
WindowInfo *info = g_new0 (WindowInfo, 1);
737737

738-
meta_error_trap_push_with_return (screen->display);
738+
meta_error_trap_push (screen->display);
739739

740740
XGetWindowAttributes (screen->display->xdisplay,
741741
children[i], &info->attrs);

src/core/stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ raise_window_relative_to_managed_windows (MetaScreen *screen,
964964
* or restack any windows before using the XQueryTree results.
965965
*/
966966

967-
meta_error_trap_push_with_return (screen->display);
967+
meta_error_trap_push (screen->display);
968968

969969
XQueryTree (screen->display->xdisplay,
970970
screen->xroot,

src/core/window.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ meta_window_new (MetaDisplay *display,
220220
* creation, to reduce XSync() calls
221221
*/
222222

223-
meta_error_trap_push_with_return (display);
223+
meta_error_trap_push (display);
224224

225225
if (XGetWindowAttributes (display->xdisplay,xwindow, &attrs))
226226
{
@@ -328,7 +328,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
328328
wm_state_to_string (existing_wm_state));
329329
}
330330

331-
meta_error_trap_push_with_return (display);
331+
meta_error_trap_push (display);
332332

333333
XAddToSaveSet (display->xdisplay, xwindow);
334334

@@ -5101,12 +5101,12 @@ meta_window_client_message (MetaWindow *window,
51015101
char *str1;
51025102
char *str2;
51035103

5104-
meta_error_trap_push_with_return (display);
5104+
meta_error_trap_push (display);
51055105
str1 = XGetAtomName (display->xdisplay, first);
51065106
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
51075107
str1 = NULL;
51085108

5109-
meta_error_trap_push_with_return (display);
5109+
meta_error_trap_push (display);
51105110
str2 = XGetAtomName (display->xdisplay, second);
51115111
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
51125112
str2 = NULL;
@@ -8348,7 +8348,7 @@ warp_grab_pointer (MetaWindow *window,
83488348
*x = CLAMP (*x, 0, window->screen->rect.width-1);
83498349
*y = CLAMP (*y, 0, window->screen->rect.height-1);
83508350

8351-
meta_error_trap_push_with_return (display);
8351+
meta_error_trap_push (display);
83528352

83538353
meta_topic (META_DEBUG_WINDOW_OPS,
83548354
"Warping pointer to %d,%d with window at %d,%d\n",

src/core/xprops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ get_property (MetaDisplay *display,
193193
results->bytes_after = 0;
194194
results->format = 0;
195195

196-
meta_error_trap_push_with_return (display);
196+
meta_error_trap_push (display);
197197
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
198198
0, G_MAXLONG,
199199
False, req_type, &results->type, &results->format,

src/include/errors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ void meta_error_trap_push (MetaDisplay *display);
4141
void meta_error_trap_pop (MetaDisplay *display,
4242
gboolean last_request_was_roundtrip);
4343

44-
void meta_error_trap_push_with_return (MetaDisplay *display);
4544
/* returns X error code, or 0 for no error */
4645
int meta_error_trap_pop_with_return (MetaDisplay *display,
4746
gboolean last_request_was_roundtrip);

0 commit comments

Comments
 (0)