[gtk+] GdkDisplay: Add a private _emit_opened
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GdkDisplay: Add a private _emit_opened
- Date: Tue, 10 Oct 2017 07:58:31 +0000 (UTC)
commit 63eb3517be7b812759ecc663b667432532174ffe
Author: Timm Bäder <mail baedert org>
Date: Sun Oct 8 17:38:38 2017 +0200
GdkDisplay: Add a private _emit_opened
So we don't have to use the slower g_signal_emit_by_name in startup
paths.
gdk/gdkdisplay.c | 6 ++++++
gdk/gdkdisplayprivate.h | 1 +
gdk/wayland/gdkdisplay-wayland.c | 2 +-
gdk/x11/gdkdisplay-x11.c | 3 ++-
4 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 6d45b07..5e75773 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -2217,3 +2217,9 @@ gdk_display_monitor_removed (GdkDisplay *display,
g_signal_emit (display, signals[MONITOR_REMOVED], 0, monitor);
gdk_monitor_invalidate (monitor);
}
+
+void
+gdk_display_emit_opened (GdkDisplay *display)
+{
+ g_signal_emit (display, signals[OPENED], 0);
+}
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index a0d9dc2..cd3ef34 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -301,6 +301,7 @@ void gdk_display_monitor_added (GdkDisplay *display
GdkMonitor *monitor);
void gdk_display_monitor_removed (GdkDisplay *display,
GdkMonitor *monitor);
+void gdk_display_emit_opened (GdkDisplay *display);
G_END_DECLS
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 31e1935..2154e51 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -584,7 +584,7 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->selection = gdk_wayland_selection_new ();
- g_signal_emit_by_name (display, "opened");
+ gdk_display_emit_opened (display);
return display;
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 74c0ecf..cc34d8c 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -42,6 +42,7 @@
#include "gdkglcontext-x11.h"
#include "gdkvulkancontext-x11.h"
#include "gdk-private.h"
+#include "gdkdisplayprivate.h"
#include <glib.h>
#include <glib/gprintf.h>
@@ -1780,7 +1781,7 @@ _gdk_x11_display_open (const gchar *display_name)
gdk_display_set_composited (GDK_DISPLAY (display),
XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), get_cm_atom (display)) !=
None);
- g_signal_emit_by_name (display, "opened");
+ gdk_display_emit_opened (display);
return display;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]