* src/hildon-note.c (hildon_note_realize): * src/hildon-banner.c (hildon_banner_reali...
authorAlberto Garcia <agarcia@igalia.com>
Wed, 11 Jun 2008 14:57:48 +0000 (14:57 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 11 Jun 2008 14:57:48 +0000 (14:57 +0000)
ChangeLog
src/hildon-banner.c
src/hildon-note.c

index ade0891..276549a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-11  Alberto Garcia  <agarcia@igalia.com>
+
+       * src/hildon-note.c (hildon_note_realize):
+       * src/hildon-banner.c (hildon_banner_realize):
+       Add WM hints for Matchbox
+
 2008-06-10  Alberto Garcia  <agarcia@igalia.com>
 
        * src/hildon-app-menu-private.h
index a3da589..7289add 100644 (file)
@@ -714,6 +714,9 @@ hildon_banner_check_position                    (GtkWidget *widget)
 static void
 hildon_banner_realize                           (GtkWidget *widget)
 {
+    GdkDisplay *display;
+    Atom atom;
+    const gchar *notification_type = "_HILDON_NOTIFICATION_TYPE_BANNER";
     HildonBannerPrivate *priv = HILDON_BANNER_GET_PRIVATE (widget);
     g_assert (priv);
 
@@ -726,6 +729,13 @@ hildon_banner_realize                           (GtkWidget *widget)
     gtk_window_set_transient_for (GTK_WINDOW (widget), (GtkWindow *) priv->parent);
 
     hildon_banner_check_position (widget);
+
+    /* Set the _HILDON_NOTIFICATION_TYPE property so Matchbox places the window correctly */
+    display = gdk_drawable_get_display (widget->window);
+    atom = gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_NOTIFICATION_TYPE");
+    XChangeProperty (GDK_WINDOW_XDISPLAY (widget->window), GDK_WINDOW_XID (widget->window),
+                     atom, XA_STRING, 8, PropModeReplace, (guchar *) notification_type,
+                     strlen (notification_type));
 }
 
 static void 
index 3f65db7..821c30f 100644 (file)
@@ -65,6 +65,8 @@
 #include                                        "hildon-enum-types.h"
 #include                                        <stdio.h>
 #include                                        <string.h>
+#include                                        <X11/X.h>
+#include                                        <X11/Xatom.h>
 #include                                        "hildon-note-private.h"
 
 #define                                         CONFIRMATION_SOUND_PATH \
@@ -495,6 +497,9 @@ hildon_note_unmap                               (GtkWidget *widget)
 static void
 hildon_note_realize                             (GtkWidget *widget)
 {
+    GdkDisplay *display;
+    Atom atom;
+    const gchar *notification_type;
     HildonNotePrivate *priv = HILDON_NOTE_GET_PRIVATE (widget);
     g_assert (priv);
 
@@ -512,6 +517,21 @@ hildon_note_realize                             (GtkWidget *widget)
 
     /* We use special hint to turn the note into information notification. */
     gdk_window_set_type_hint (widget->window, GDK_WINDOW_TYPE_HINT_NOTIFICATION);
+
+    /* Set the _HILDON_NOTIFICATION_TYPE property so Matchbox places the window correctly */
+    display = gdk_drawable_get_display (widget->window);
+    atom = gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_NOTIFICATION_TYPE");
+
+    if (priv->note_n == HILDON_NOTE_TYPE_INFORMATION ||
+        priv->note_n == HILDON_NOTE_TYPE_INFORMATION_THEME) {
+        notification_type = "_HILDON_NOTIFICATION_TYPE_INFO";
+    } else {
+        notification_type = "_HILDON_NOTIFICATION_TYPE_CONFIRMATION";
+    }
+
+    XChangeProperty (GDK_WINDOW_XDISPLAY (widget->window), GDK_WINDOW_XID (widget->window),
+                     atom, XA_STRING, 8, PropModeReplace, (guchar *) notification_type,
+                     strlen (notification_type));
 }
 
 /* Helper function for removing a widget from it's container.