/**
* SECTION:hildon-window
- * @short_description: Widget representing a top-level window in the Hildon framework.
+ * @short_description: Top-level window in the Hildon framework.
* @see_also: #HildonProgram, #HildonStackableWindow
*
- * #HildonWindow is a GTK widget which represents a top-level
+ * #HildonWindow is a top-level
* window in the Hildon framework. It is derived from #GtkWindow
* and provides additional commodities specific to the Hildon
* framework.
#include "hildon-app-menu-private.h"
#include "hildon-find-toolbar.h"
#include "hildon-defines.h"
+#include "hildon-private.h"
#define _(String) gettext(String)
case HILDON_HARDKEY_ESC:
if (!priv->escape_timeout)
{
- priv->escape_timeout = g_timeout_add
+ priv->escape_timeout = gdk_threads_add_timeout
(HILDON_WINDOW_LONG_PRESS_TIME,
hildon_window_escape_timeout, widget);
}
g_assert (priv);
- GDK_THREADS_ENTER ();
-
/* Send fake event, simulation a situation that user
pressed 'x' from the corner */
event = gdk_event_new(GDK_DELETE);
priv->escape_timeout = 0;
- GDK_THREADS_LEAVE ();
-
return FALSE;
}
gtk_window_add_accel_group (GTK_WINDOW (self), accel_group);
}
+static void
+do_set_has_menu (GtkWindow *window,
+ gpointer boolptr)
+{
+ gboolean has_menu = GPOINTER_TO_INT (boolptr);
+ hildon_gtk_window_set_clear_window_flag (window, "_HILDON_WM_WINDOW_MENU_INDICATOR",
+ XA_INTEGER, has_menu);
+ g_signal_handlers_disconnect_matched (window, G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, do_set_has_menu, NULL);
+}
+
+void
+hildon_window_set_menu_flag (HildonWindow *window,
+ gboolean has_menu)
+{
+ hildon_gtk_window_set_flag (GTK_WINDOW (window), (HildonFlagFunc) do_set_has_menu,
+ GUINT_TO_POINTER (has_menu));
+}
+
/**
* hildon_window_set_main_menu:
* @self: A #HildonWindow
priv = HILDON_WINDOW_GET_PRIVATE (self);
+ hildon_window_set_menu_flag (self, menu != NULL);
+
if (priv->menu != NULL)
{
accel_group = gtk_menu_get_accel_group (priv->menu);
old_menu = priv->app_menu;
+ hildon_window_set_menu_flag (self, menu != NULL);
+
/* Add new menu */
priv->app_menu = menu;
if (menu)