mirror of
https://github.com/brl/mutter.git
synced 2025-08-09 18:04:44 +00:00
Split GDK initialization from MetaUI
Get rid of the deprecated gdk_display_get_default_screen () https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:

committed by
Jonas Ådahl

parent
89727aa747
commit
d4c4d6e64d
@@ -404,8 +404,7 @@ gboolean meta_display_show_resize_popup (MetaDisplay *display,
|
||||
int display_w,
|
||||
int display_h);
|
||||
|
||||
void meta_restart_init (void);
|
||||
void meta_restart_finish (void);
|
||||
void meta_set_is_restart (gboolean whether);
|
||||
|
||||
void meta_display_cancel_touch (MetaDisplay *display);
|
||||
|
||||
|
@@ -46,32 +46,17 @@
|
||||
void
|
||||
meta_error_trap_push (MetaX11Display *x11_display)
|
||||
{
|
||||
GdkDisplay *gdk_display;
|
||||
|
||||
gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay);
|
||||
g_assert (gdk_display != NULL);
|
||||
|
||||
gdk_x11_display_error_trap_push (gdk_display);
|
||||
gdk_x11_display_error_trap_push (x11_display->gdk_display);
|
||||
}
|
||||
|
||||
void
|
||||
meta_error_trap_pop (MetaX11Display *x11_display)
|
||||
{
|
||||
GdkDisplay *gdk_display;
|
||||
|
||||
gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay);
|
||||
g_assert (gdk_display != NULL);
|
||||
|
||||
gdk_x11_display_error_trap_pop_ignored (gdk_display);
|
||||
gdk_x11_display_error_trap_pop_ignored (x11_display->gdk_display);
|
||||
}
|
||||
|
||||
int
|
||||
meta_error_trap_pop_with_return (MetaX11Display *x11_display)
|
||||
{
|
||||
GdkDisplay *gdk_display;
|
||||
|
||||
gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay);
|
||||
g_assert (gdk_display != NULL);
|
||||
|
||||
return gdk_x11_display_error_trap_pop (gdk_display);
|
||||
return gdk_x11_display_error_trap_pop (x11_display->gdk_display);
|
||||
}
|
||||
|
@@ -599,10 +599,6 @@ meta_init (void)
|
||||
meta_fatal ("Can't specify both SM save file and SM client id\n");
|
||||
|
||||
meta_main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
meta_ui_init ();
|
||||
|
||||
meta_restart_init ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -50,15 +50,9 @@ static gboolean restart_message_shown = FALSE;
|
||||
static gboolean is_restart = FALSE;
|
||||
|
||||
void
|
||||
meta_restart_init (void)
|
||||
meta_set_is_restart (gboolean whether)
|
||||
{
|
||||
Display *xdisplay = meta_ui_get_display ();
|
||||
Atom atom_restart_helper = XInternAtom (xdisplay, "_MUTTER_RESTART_HELPER", False);
|
||||
Window restart_helper_window = None;
|
||||
|
||||
restart_helper_window = XGetSelectionOwner (xdisplay, atom_restart_helper);
|
||||
if (restart_helper_window)
|
||||
is_restart = TRUE;
|
||||
is_restart = whether;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -187,18 +181,6 @@ meta_restart (const char *message)
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
meta_restart_finish (void)
|
||||
{
|
||||
if (is_restart)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
Atom atom_restart_helper = XInternAtom (xdisplay, "_MUTTER_RESTART_HELPER", False);
|
||||
XSetSelectionOwner (xdisplay, atom_restart_helper, None, META_CURRENT_TIME);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_is_restart:
|
||||
*
|
||||
|
Reference in New Issue
Block a user