Files
tubestation/widget/gtk/compat/gdk/gdkx.h
Oliver Henshaw 94b214a494 Bug 694570 - (3/4) - Stop using libgnome and libgnomeui on Linux. r=acomminos
(Based on original patch by Chris Coulson.)

Replace session management through libgnome with direct use of libSM and
libICE. This allows xsmp session restore on gtk2 and gtk3 builds.

Changes in behaviour:
- It now only sends the "session-save" notification when the save style
is SmSaveLocal or SmSaveBoth. Saving internal state with a save style of
SmSaveGlobal is actually incorrect. This means that Firefox now
distinguishes between a normal session exit and a session exit with
session saving enabled.
- As "quit-application-requested" might pop up a dialog, it only does
  this if the interact style is not SmInteractStyleNone
- "quit-application-requested" is only sent after sending
  SmcInteractRequest and receiving an interact message.
- It defers closing the connection to the session manager until
  the destructor, i.e after the "web-workers-shutdown" async shutdown
  phase completes. This means that firefox shouldn't be killed too early
  and lose data (*).

* It still might be killed prematurely if it takes too long to quit and
  the session manager decides to timeout, but that's another story.
2016-06-20 08:13:00 +02:00

52 lines
1.4 KiB
C

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GDKX_WRAPPER_H
#define GDKX_WRAPPER_H
#include <gtk/gtkversion.h>
#define gdk_x11_window_foreign_new_for_display gdk_x11_window_foreign_new_for_display_
#define gdk_x11_window_lookup_for_display gdk_x11_window_lookup_for_display_
#define gdk_x11_window_get_xid gdk_x11_window_get_xid_
#if !GTK_CHECK_VERSION(2,24,0)
#define gdk_x11_set_sm_client_id gdk_x11_set_sm_client_id_
#endif
#include_next <gdk/gdkx.h>
#undef gdk_x11_window_foreign_new_for_display
#undef gdk_x11_window_lookup_for_display
#undef gdk_x11_window_get_xid
static inline GdkWindow *
gdk_x11_window_foreign_new_for_display(GdkDisplay *display, Window window)
{
return gdk_window_foreign_new_for_display(display, window);
}
static inline GdkWindow *
gdk_x11_window_lookup_for_display(GdkDisplay *display, Window window)
{
return gdk_window_lookup_for_display(display, window);
}
static inline Window
gdk_x11_window_get_xid(GdkWindow *window)
{
return(GDK_WINDOW_XWINDOW(window));
}
#ifndef GDK_IS_X11_DISPLAY
#define GDK_IS_X11_DISPLAY(a) (true)
#endif
#if !GTK_CHECK_VERSION(2,24,0)
#undef gdk_x11_set_sm_client_id
static inline void
gdk_x11_set_sm_client_id (const gchar *sm_client_id)
{
gdk_set_sm_client_id(sm_client_id);
}
#endif
#endif /* GDKX_WRAPPER_H */