[recipes] Add unexport api too
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Add unexport api too
- Date: Tue, 14 Feb 2017 23:52:23 +0000 (UTC)
commit 76606f2f6ea6a3929cab744c5b66c46ccb67cb18
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Feb 14 18:43:45 2017 -0500
Add unexport api too
Under wayland, it is necessary to explicitly unexport handles.
src/gr-utils.c | 15 ++++++++++++++-
src/gr-utils.h | 3 +++
2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-utils.c b/src/gr-utils.c
index a1b7e60..30038bb 100644
--- a/src/gr-utils.c
+++ b/src/gr-utils.c
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
@@ -567,7 +568,7 @@ wayland_window_handle_exported (GdkWindow *window,
}
#endif
-static gboolean
+gboolean
window_export_handle (GtkWindow *window,
WindowHandleExported callback,
gpointer user_data)
@@ -613,3 +614,15 @@ window_export_handle (GtkWindow *window,
return FALSE;
}
+void
+window_unexport_handle (GtkWindow *window)
+{
+#ifdef GDK_WINDOWING_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+ {
+ GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+
+ gdk_wayland_window_unexport_handle (gdk_window);
+ }
+#endif
+}
diff --git a/src/gr-utils.h b/src/gr-utils.h
index 6c0a8f3..48be8dc 100644
--- a/src/gr-utils.h
+++ b/src/gr-utils.h
@@ -76,3 +76,6 @@ gboolean
window_export_handle (GtkWindow *window,
WindowHandleExported callback,
gpointer user_data);
+
+void
+window_unexport_handle (GtkWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]