Skip to content
Permalink
Browse files

Fixed some gdk deprecations

  • Loading branch information...
yetist authored and raveit65 committed May 12, 2018
1 parent ce87b58 commit abaa88eaf6b495949199afd5886a519f89c39f36
Showing with 32 additions and 19 deletions.
  1. +3 −1 src/gs-fade.c
  2. +5 −5 src/gs-grab-x11.c
  3. +2 −2 src/gs-manager.c
  4. +22 −11 src/gs-window-x11.c
@@ -174,6 +174,7 @@ xf86_whack_gamma (int screen,
{
Bool status;
struct GSGammaInfo *gamma_info;
GdkDisplay *display;

gamma_info = screen_priv->info;

@@ -243,7 +244,8 @@ xf86_whack_gamma (int screen,
# endif /* !HAVE_XF86VMODE_GAMMA_RAMP */
}

gdk_flush ();
display = gdk_display_get_default ();
gdk_display_flush (display);

return status;
}
@@ -259,8 +259,8 @@ gs_grab_release (GSGrab *grab, gboolean flush)
/* FIXME: is it right to enable this? */
xorg_lock_smasher_set_active (grab, TRUE);

gdk_display_sync (gdk_display_get_default ());
gdk_flush ();
gdk_display_sync (display);
gdk_display_flush (display);
}
}

@@ -345,13 +345,13 @@ gs_grab_nuke_focus (GdkDisplay *display)

gs_debug ("Nuking focus");

gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);

XGetInputFocus (GDK_DISPLAY_XDISPLAY (display), &focus, &rev);
XSetInputFocus (GDK_DISPLAY_XDISPLAY (display), None,
RevertToNone, CurrentTime);

gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (display);
}

gboolean
@@ -461,7 +461,7 @@ gs_grab_move_to_window (GSGrab *grab,
{
result = gs_grab_move (grab, window, display,
no_pointer_grab, hide_cursor);
gdk_flush ();
gdk_display_flush (display);
}
}

@@ -1174,7 +1174,7 @@ manager_maybe_grab_window (GSManager *manager,
gdk_device_get_position (device, NULL, &x, &y);
monitor = gdk_display_get_monitor_at_point (display, x, y);

gdk_flush ();
gdk_display_flush (display);
grabbed = FALSE;
if (gs_window_get_display (window) == display &&
gs_window_get_monitor (window) == monitor)
@@ -1638,7 +1638,7 @@ on_screen_monitors_changed (GdkScreen *screen,
gs_manager_request_unlock (manager);
}

gdk_flush ();
gdk_display_flush (display);
gdk_x11_ungrab_server ();
}
}
@@ -232,16 +232,19 @@ static void
widget_clear_all_children (GtkWidget *widget)
{
GdkWindow *w;
GdkDisplay *display;

gs_debug ("Clearing all child windows");
display = gtk_widget_get_display (widget);

gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);

w = gtk_widget_get_window (widget);

clear_children (GDK_WINDOW_XID (w));

gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (display);

}

void
@@ -267,6 +270,7 @@ gs_window_set_background_surface (GSWindow *window,
void
gs_window_clear (GSWindow *window)
{
GdkDisplay *display;
g_return_if_fail (GS_IS_WINDOW (window));

gs_debug ("Clearing widgets");
@@ -285,7 +289,8 @@ gs_window_clear (GSWindow *window)
widget_clear_all_children (window->priv->drawing_area);
}

gdk_flush ();
display = gtk_widget_get_display (GTK_WIDGET(window));
gdk_display_flush (display);
}

static cairo_region_t *
@@ -764,16 +769,19 @@ select_popup_events (void)
{
XWindowAttributes attr;
unsigned long events;
GdkDisplay *display;

gdk_error_trap_push ();
display = gdk_display_get_default ();

gdk_x11_display_error_trap_push (display);

memset (&attr, 0, sizeof (attr));
XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), &attr);
XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (display), GDK_ROOT_WINDOW (), &attr);

events = SubstructureNotifyMask | attr.your_event_mask;
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), events);
XSelectInput (GDK_DISPLAY_XDISPLAY (display), GDK_ROOT_WINDOW (), events);

gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (display);
}

static void
@@ -782,15 +790,18 @@ window_select_shape_events (GSWindow *window)
#ifdef HAVE_SHAPE_EXT
unsigned long events;
int shape_error_base;
GdkDisplay *display;

display = gtk_widget_get_display (GTK_WIDGET(window));

gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);

if (XShapeQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &window->priv->shape_event_base, &shape_error_base)) {
if (XShapeQueryExtension (GDK_DISPLAY_XDISPLAY (display), &window->priv->shape_event_base, &shape_error_base)) {
events = ShapeNotifyMask;
XShapeSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), events);
XShapeSelectInput (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), events);
}

gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (display);
#endif
}

0 comments on commit abaa88e

Please sign in to comment.
You can’t perform that action at this time.