Mark HildonBanner as supporting portrait mode.
authorAlberto Garcia <agarcia@igalia.com>
Mon, 20 Apr 2009 16:45:59 +0000 (18:45 +0200)
committerAlberto Garcia <agarcia@igalia.com>
Mon, 20 Apr 2009 16:45:59 +0000 (18:45 +0200)
2009-04-20  Alberto Garcia  <agarcia@igalia.com>

* src/hildon-banner.c (hildon_banner_realize):
Mark HildonBanner as supporting portrait mode.
Use GDK to set window properties insetad of direct Xlib calls.

Fixes: NB#111830 (HildonBanner should be marked as supporting
portrait)

ChangeLog
src/hildon-banner.c

index 4630980..0e8c378 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-04-20  Alberto Garcia  <agarcia@igalia.com>
 
+       * src/hildon-banner.c (hildon_banner_realize):
+       Mark HildonBanner as supporting portrait mode.
+       Use GDK to set window properties insetad of direct Xlib calls.
+
+       Fixes: NB#111830 (HildonBanner should be marked as supporting
+       portrait)
+
+2009-04-20  Alberto Garcia  <agarcia@igalia.com>
+
        * src/hildon-note.c (hildon_note_rebuild):
        Hide action area in information notes. Prevents text from being
        slightly aligned to the left.
index ceab9f0..0d65edc 100644 (file)
@@ -57,7 +57,6 @@
 
 #include                                        <string.h>
 #include                                        <X11/Xatom.h>
-#include                                        <X11/X.h>
 #include                                        <gdk/gdkx.h>
 
 #undef                                          HILDON_DISABLE_DEPRECATED
@@ -656,8 +655,9 @@ hildon_banner_check_position                    (GtkWidget *widget)
 static void
 hildon_banner_realize                           (GtkWidget *widget)
 {
-    GdkDisplay *display;
-    Atom atom;
+    GdkWindow *gdkwin;
+    GdkAtom atom;
+    guint32 portrait = 1;
     const gchar *notification_type = "_HILDON_NOTIFICATION_TYPE_BANNER";
     HildonBannerPrivate *priv = HILDON_BANNER_GET_PRIVATE (widget);
     g_assert (priv);
@@ -672,12 +672,17 @@ hildon_banner_realize                           (GtkWidget *widget)
 
     hildon_banner_check_position (widget);
 
+    gdkwin = widget->window;
+
     /* 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));
+    atom = gdk_atom_intern ("_HILDON_NOTIFICATION_TYPE", FALSE);
+    gdk_property_change (gdkwin, atom, gdk_x11_xatom_to_atom (XA_STRING), 8, GDK_PROP_MODE_REPLACE,
+                         (gpointer) notification_type, strlen (notification_type));
+
+    /* HildonBanner supports portrait mode */
+    atom = gdk_atom_intern ("_HILDON_PORTRAIT_MODE_SUPPORT", FALSE);
+    gdk_property_change (gdkwin, atom, gdk_x11_xatom_to_atom (XA_CARDINAL), 32,
+                         GDK_PROP_MODE_REPLACE, (gpointer) &portrait, 1);
 }
 
 static void