[gtk+] displaymanager: Move set_default_display vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] displaymanager: Move set_default_display vfunc
- Date: Mon, 15 Apr 2013 13:45:07 +0000 (UTC)
commit f7c0b025b9b3a5892b0b254dbc979997260f010c
Author: Benjamin Otte <otte redhat com>
Date: Tue Apr 9 13:32:03 2013 +0200
displaymanager: Move set_default_display vfunc
... to GdkDisplayClass.make_default. It's only implemented by X11
anyway.
gdk/gdkdisplay.c | 7 +++++++
gdk/gdkdisplaymanager.c | 5 +++--
gdk/gdkdisplaymanagerprivate.h | 2 --
gdk/gdkdisplayprivate.h | 1 +
gdk/wayland/gdkdisplay-wayland.c | 5 -----
gdk/wayland/gdkdisplaymanager-wayland.c | 8 --------
gdk/wayland/gdkprivate-wayland.h | 1 -
gdk/x11/gdkdisplay-x11.c | 5 +++--
gdk/x11/gdkdisplaymanager-x11.c | 9 ---------
gdk/x11/gdkprivate-x11.h | 1 -
10 files changed, 14 insertions(+), 30 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 44dc9d4..32d9d3a 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -82,6 +82,11 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
static void
+gdk_display_real_make_default (GdkDisplay *display)
+{
+}
+
+static void
gdk_display_class_init (GdkDisplayClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
@@ -92,6 +97,8 @@ gdk_display_class_init (GdkDisplayClass *class)
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
class->window_type = GDK_TYPE_WINDOW;
+ class->make_default = gdk_display_real_make_default;
+
/**
* GdkDisplay::opened:
* @display: the object on which the signal is emitted
diff --git a/gdk/gdkdisplaymanager.c b/gdk/gdkdisplaymanager.c
index 7515965..de04582 100644
--- a/gdk/gdkdisplaymanager.c
+++ b/gdk/gdkdisplaymanager.c
@@ -26,6 +26,7 @@
#include "gdkconfig.h"
#include "gdkdisplaymanagerprivate.h"
+#include "gdkdisplayprivate.h"
#include "gdkinternals.h"
#include "gdkkeysprivate.h"
#include "gdkmarshalers.h"
@@ -480,8 +481,8 @@ gdk_display_manager_set_default_display (GdkDisplayManager *manager,
{
manager->default_display = display;
- if (GDK_DISPLAY_MANAGER_GET_CLASS (manager)->set_default_display)
- GDK_DISPLAY_MANAGER_GET_CLASS (manager)->set_default_display (manager, display);
+ if (display)
+ GDK_DISPLAY_GET_CLASS (display)->make_default (display);
g_object_notify (G_OBJECT (manager), "default-display");
}
diff --git a/gdk/gdkdisplaymanagerprivate.h b/gdk/gdkdisplaymanagerprivate.h
index 547ea71..6123f81 100644
--- a/gdk/gdkdisplaymanagerprivate.h
+++ b/gdk/gdkdisplaymanagerprivate.h
@@ -40,8 +40,6 @@ struct _GdkDisplayManagerClass
GObjectClass parent_class;
GSList * (*list_displays) (GdkDisplayManager *manager);
- void (*set_default_display) (GdkDisplayManager *manager,
- GdkDisplay *display);
GdkDisplay * (*open_display) (GdkDisplayManager *manager,
const gchar *name);
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index d8e2784..69fffb1 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -142,6 +142,7 @@ struct _GdkDisplayClass
void (*flush) (GdkDisplay *display);
gboolean (*has_pending) (GdkDisplay *display);
void (*queue_events) (GdkDisplay *display);
+ void (*make_default) (GdkDisplay *display);
GdkWindow * (*get_default_group) (GdkDisplay *display);
gboolean (*supports_selection_notification) (GdkDisplay *display);
gboolean (*request_selection_notification) (GdkDisplay *display,
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 83b8dc1..ee42ea9 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -424,11 +424,6 @@ gdk_wayland_display_get_next_serial (GdkDisplay *display)
return ++serial;
}
-void
-_gdk_wayland_display_make_default (GdkDisplay *display)
-{
-}
-
/**
* gdk_wayland_display_broadcast_startup_message:
* @display: a #GdkDisplay
diff --git a/gdk/wayland/gdkdisplaymanager-wayland.c b/gdk/wayland/gdkdisplaymanager-wayland.c
index ac43caa..43a9960 100644
--- a/gdk/wayland/gdkdisplaymanager-wayland.c
+++ b/gdk/wayland/gdkdisplaymanager-wayland.c
@@ -106,13 +106,6 @@ gdk_wayland_display_manager_list_displays (GdkDisplayManager *manager)
return g_slist_copy (GDK_WAYLAND_DISPLAY_MANAGER (manager)->displays);
}
-static void
-gdk_wayland_display_manager_set_default_display (GdkDisplayManager *manager,
- GdkDisplay *display)
-{
- _gdk_wayland_display_make_default (display);
-}
-
static GdkAtom
gdk_wayland_display_manager_atom_intern (GdkDisplayManager *manager_in,
const gchar *atom_name,
@@ -205,7 +198,6 @@ gdk_wayland_display_manager_class_init (GdkWaylandDisplayManagerClass *class)
manager_class->open_display = gdk_wayland_display_manager_open_display;
manager_class->list_displays = gdk_wayland_display_manager_list_displays;
- manager_class->set_default_display = gdk_wayland_display_manager_set_default_display;
manager_class->atom_intern = gdk_wayland_display_manager_atom_intern;
manager_class->get_atom_name = gdk_wayland_display_manager_get_atom_name;
manager_class->lookup_keyval = gdk_wayland_display_manager_lookup_keyval;
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index a39893d..02d5b6d 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -156,7 +156,6 @@ void _gdk_wayland_display_queue_events (GdkDisplay *display);
GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display);
GdkDisplay *_gdk_wayland_display_open (const gchar *display_name);
-void _gdk_wayland_display_make_default (GdkDisplay *display);
GdkWindow *_gdk_wayland_screen_create_root_window (GdkScreen *screen,
int width,
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 224ad17..fc4c979 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1997,8 +1997,8 @@ gdk_x11_display_get_xdisplay (GdkDisplay *display)
return GDK_X11_DISPLAY (display)->xdisplay;
}
-void
-_gdk_x11_display_make_default (GdkDisplay *display)
+static void
+gdk_x11_display_make_default (GdkDisplay *display)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
const gchar *startup_id;
@@ -2791,6 +2791,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->beep = gdk_x11_display_beep;
display_class->sync = gdk_x11_display_sync;
display_class->flush = gdk_x11_display_flush;
+ display_class->make_default = gdk_x11_display_make_default;
display_class->has_pending = gdk_x11_display_has_pending;
display_class->queue_events = _gdk_x11_display_queue_events;
display_class->get_default_group = gdk_x11_display_get_default_group;
diff --git a/gdk/x11/gdkdisplaymanager-x11.c b/gdk/x11/gdkdisplaymanager-x11.c
index d591358..61c04df 100644
--- a/gdk/x11/gdkdisplaymanager-x11.c
+++ b/gdk/x11/gdkdisplaymanager-x11.c
@@ -99,14 +99,6 @@ gdk_x11_display_manager_list_displays (GdkDisplayManager *manager)
}
static void
-gdk_x11_display_manager_set_default_display (GdkDisplayManager *manager,
- GdkDisplay *display)
-{
- if (display)
- _gdk_x11_display_make_default (display);
-}
-
-static void
gdk_x11_display_manager_init (GdkX11DisplayManager *manager)
{
_gdk_x11_windowing_init ();
@@ -130,7 +122,6 @@ gdk_x11_display_manager_class_init (GdkX11DisplayManagerClass *class)
manager_class->open_display = gdk_x11_display_manager_open_display;
manager_class->list_displays = gdk_x11_display_manager_list_displays;
- manager_class->set_default_display = gdk_x11_display_manager_set_default_display;
manager_class->atom_intern = _gdk_x11_display_manager_atom_intern;
manager_class->get_atom_name = _gdk_x11_display_manager_get_atom_name;
manager_class->lookup_keyval = _gdk_x11_display_manager_lookup_keyval;
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 2bdda3d..6f7754a 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -168,7 +168,6 @@ gboolean _gdk_x11_display_is_root_window (GdkDisplay *display,
Window xroot_window);
GdkDisplay * _gdk_x11_display_open (const gchar *display_name);
-void _gdk_x11_display_make_default (GdkDisplay *display);
void _gdk_x11_display_update_grab_info (GdkDisplay *display,
GdkDevice *device,
gint status);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]