summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes_applet.c
diff options
context:
space:
mode:
Diffstat (limited to 'stickynotes/stickynotes_applet.c')
-rw-r--r--stickynotes/stickynotes_applet.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index c697151e..d88709da 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -84,11 +84,11 @@ stickynotes_applet_factory (MatePanelApplet *mate_panel_applet,
}
/* Sticky Notes applet factory */
-MATE_PANEL_APPLET_OUT_PROCESS_FACTORY ("StickyNotesAppletFactory",
- PANEL_TYPE_APPLET,
- "stickynotes_applet",
- stickynotes_applet_factory,
- NULL)
+PANEL_APPLET_FACTORY ("StickyNotesAppletFactory",
+ PANEL_TYPE_APPLET,
+ "stickynotes_applet",
+ stickynotes_applet_factory,
+ NULL)
/* colorshift a surface */
static void
@@ -166,6 +166,8 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
{
cairo_t *cr;
gint size, scale;
+ int screen_height;
+ GdkScreen *screen;
stickynotes = g_new (StickyNotes, 1);
@@ -176,7 +178,9 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
size = mate_panel_applet_get_size (mate_panel_applet);
scale = gtk_widget_get_scale_factor (GTK_WIDGET (mate_panel_applet));
+#ifndef ENABLE_IN_PROCESS
g_set_application_name (_("Sticky Notes"));
+#endif
gtk_window_set_default_icon_name ("mate-sticky-notes-applet");
stickynotes->icon_normal =
@@ -207,14 +211,22 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
g_signal_connect (stickynotes->settings, "changed",
G_CALLBACK (preferences_apply_cb), NULL);
- /* Max height for large notes*/
- stickynotes->max_height =
- 0.8 * HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()));
+ /* Max height for large notes in x11 only
+ * In wayland we do not have access to global screen dimensions
+ */
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (mate_panel_applet));
+#ifdef GDK_WINDOWING_X11
+ if (GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen)))
+ screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+#endif
+
+ stickynotes->max_height = (int) (0.8 * (double) screen_height);
/* Load sticky notes */
- stickynotes_load (gtk_widget_get_screen (GTK_WIDGET (mate_panel_applet)));
+ stickynotes_load (screen);
- install_check_click_on_desktop ();
+ install_check_click_on_desktop (screen);
}
void