summaryrefslogtreecommitdiff
path: root/src/daemon/engines.c
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2020-09-14 02:38:48 -0700
committerraveit65 <[email protected]>2020-10-24 16:49:14 +0200
commit590bedf604ccc05cb9e41c3fc15d93ff827e7f65 (patch)
treed2f912b0867e8c8efcc22a1d3198dc6b3eb4150e /src/daemon/engines.c
parent550f2a11921b48bc1c876b5e7fcc42cc2a4da07f (diff)
downloadmate-notification-daemon-590bedf604ccc05cb9e41c3fc15d93ff827e7f65.tar.bz2
mate-notification-daemon-590bedf604ccc05cb9e41c3fc15d93ff827e7f65.tar.xz
Implement placement on Wayland
Diffstat (limited to 'src/daemon/engines.c')
-rw-r--r--src/daemon/engines.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/daemon/engines.c b/src/daemon/engines.c
index db50e8b..3a0334e 100644
--- a/src/daemon/engines.c
+++ b/src/daemon/engines.c
@@ -26,6 +26,11 @@
#include "daemon.h"
#include "engines.h"
+#ifdef HAVE_WAYLAND
+#include <gdk/gdkwayland.h>
+#include "wayland.h"
+#endif // HAVE_WAYLAND
+
typedef struct {
GModule* module;
guint ref_count;
@@ -206,6 +211,12 @@ GtkWindow* theme_create_notification(UrlClickedCb url_clicked_cb)
GtkWindow* nw = engine->create_notification(url_clicked_cb);
g_object_set_data_full(G_OBJECT(nw), "_theme_engine", engine, (GDestroyNotify) theme_engine_unref);
engine->ref_count++;
+#if HAVE_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
+ {
+ wayland_init_notification (nw);
+ }
+#endif // HAVE_WAYLAND
return nw;
}
@@ -313,6 +324,12 @@ void theme_clear_notification_actions(GtkWindow* nw)
void theme_move_notification(GtkWindow* nw, int x, int y)
{
+#if HAVE_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
+ {
+ wayland_move_notification (nw, x, y);
+ }
+#endif // HAVE_WAYLAND
ThemeEngine* engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
engine->move_notification(nw, x, y);
}