[gtk+] x11: Call grab functions directly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Call grab functions directly
- Date: Tue, 19 Feb 2013 13:47:37 +0000 (UTC)
commit 7800e68b7351e607437e168a3a5b133d35ab9772
Author: Benjamin Otte <otte redhat com>
Date: Sun Feb 10 01:24:28 2013 +0100
x11: Call grab functions directly
... instead of going via vfuncs.
gdk/x11/gdkscreen-x11.c | 20 +-------------------
gdk/x11/xsettings-client.c | 34 +++-------------------------------
gdk/x11/xsettings-client.h | 11 +----------
3 files changed, 5 insertions(+), 60 deletions(-)
---
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 94f4705..6e551cb 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -1609,22 +1609,6 @@ gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen,
return FALSE;
}
-static void
-refcounted_grab_server (Display *xdisplay)
-{
- GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
-
- gdk_x11_display_grab (display);
-}
-
-static void
-refcounted_ungrab_server (Display *xdisplay)
-{
- GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
-
- gdk_x11_display_ungrab (display);
-}
-
static GdkFilterReturn
gdk_xsettings_client_event_filter (GdkXEvent *xevent,
GdkEvent *event,
@@ -1734,9 +1718,7 @@ _gdk_x11_screen_init_events (GdkScreen *screen)
x11_screen->xsettings_client = xsettings_client_new (screen,
gdk_xsettings_notify_cb,
gdk_xsettings_watch_cb,
- screen,
- refcounted_grab_server,
- refcounted_ungrab_server);
+ screen);
x11_screen->xsettings_in_init = FALSE;
}
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index 1a92b68..da7d55b 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -45,9 +45,6 @@ struct _XSettingsClient
XSettingsWatchFunc watch;
void *cb_data;
- XSettingsGrabFunc grab;
- XSettingsGrabFunc ungrab;
-
Window manager_window;
Atom manager_atom;
Atom selection_atom;
@@ -418,10 +415,7 @@ check_manager_window (XSettingsClient *client)
if (client->manager_window && client->watch)
client->watch (client->manager_window, False, 0, client->cb_data);
- if (client->grab)
- client->grab (client->display);
- else
- XGrabServer (client->display);
+ gdk_x11_display_grab (gdk_screen_get_display (client->screen));
client->manager_window = XGetSelectionOwner (client->display,
client->selection_atom);
@@ -429,10 +423,7 @@ check_manager_window (XSettingsClient *client)
XSelectInput (client->display, client->manager_window,
PropertyChangeMask | StructureNotifyMask);
- if (client->ungrab)
- client->ungrab (client->display);
- else
- XUngrabServer (client->display);
+ gdk_x11_display_ungrab (gdk_screen_get_display (client->screen));
XFlush (client->display);
@@ -458,9 +449,7 @@ XSettingsClient *
xsettings_client_new (GdkScreen *screen,
XSettingsNotifyFunc notify,
XSettingsWatchFunc watch,
- void *cb_data,
- XSettingsGrabFunc grab,
- XSettingsGrabFunc ungrab)
+ void *cb_data)
{
XSettingsClient *client;
char buffer[256];
@@ -476,8 +465,6 @@ xsettings_client_new (GdkScreen *screen,
client->notify = notify;
client->watch = watch;
client->cb_data = cb_data;
- client->grab = grab;
- client->ungrab = ungrab;
client->manager_window = None;
client->settings = NULL;
@@ -505,21 +492,6 @@ xsettings_client_new (GdkScreen *screen,
return client;
}
-
-void
-xsettings_client_set_grab_func (XSettingsClient *client,
- XSettingsGrabFunc grab)
-{
- client->grab = grab;
-}
-
-void
-xsettings_client_set_ungrab_func (XSettingsClient *client,
- XSettingsGrabFunc ungrab)
-{
- client->ungrab = ungrab;
-}
-
void
xsettings_client_destroy (XSettingsClient *client)
{
diff --git a/gdk/x11/xsettings-client.h b/gdk/x11/xsettings-client.h
index cb6ab9b..69ffca1 100644
--- a/gdk/x11/xsettings-client.h
+++ b/gdk/x11/xsettings-client.h
@@ -35,8 +35,6 @@ extern "C" {
#define xsettings_client_destroy _gdk_x11_xsettings_client_destroy
#define xsettings_client_get_setting _gdk_x11_xsettings_client_get_setting
#define xsettings_client_new _gdk_x11_xsettings_client_new
-#define xsettings_client_set_grab_func _gdk_x11_xsettings_client_set_grab_func
-#define xsettings_client_set_ungrab_func _gdk_x11_xsettings_client_set_ungrab_func
#define xsettings_client_process_event _gdk_x11_xsettings_client_process_event
#define xsettings_setting_equal _gdk_x11_xsettings_setting_equal
#define xsettings_setting_free _gdk_x11_xsettings_setting_free
@@ -106,7 +104,6 @@ typedef Bool (*XSettingsWatchFunc) (Window window,
Bool is_start,
long mask,
void *cb_data);
-typedef void (*XSettingsGrabFunc) (Display *display);
void xsettings_setting_free (XSettingsSetting *setting);
int xsettings_setting_equal (XSettingsSetting *setting_a,
@@ -115,13 +112,7 @@ int xsettings_setting_equal (XSettingsSetting *setting_
XSettingsClient *xsettings_client_new (GdkScreen *screen,
XSettingsNotifyFunc notify,
XSettingsWatchFunc watch,
- void *cb_data,
- XSettingsGrabFunc grab,
- XSettingsGrabFunc ungrab);
-void xsettings_client_set_grab_func (XSettingsClient *client,
- XSettingsGrabFunc grab);
-void xsettings_client_set_ungrab_func (XSettingsClient *client,
- XSettingsGrabFunc ungrab);
+ void *cb_data);
void xsettings_client_destroy (XSettingsClient *client);
Bool xsettings_client_process_event (XSettingsClient *client,
XEvent *xev);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]