displaymanager: Move set_default_display vfunc

... to GdkDisplayClass.make_default. It's only implemented by X11
anyway.
This commit is contained in:
Benjamin Otte 2013-04-09 13:32:03 +02:00
parent 839f402191
commit f7c0b025b9
10 changed files with 14 additions and 30 deletions

View File

@ -81,6 +81,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)
{
@ -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

View File

@ -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");
}

View File

@ -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);

View File

@ -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,

View File

@ -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

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -98,14 +98,6 @@ gdk_x11_display_manager_list_displays (GdkDisplayManager *manager)
return g_slist_copy (GDK_X11_DISPLAY_MANAGER (manager)->displays);
}
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)
{
@ -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;

View File

@ -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);