[Xfce4-commits] <midori:master> Enable Zoom and Fullscreen with hardware keys on Hildon

Christian Dywan noreply at xfce.org
Sun Nov 29 15:12:03 CET 2009


Updating branch refs/heads/master
         to 2973df0f9b76cac74cd516b05c62f802c2631272 (commit)
       from d9eb5dcec9d55cf39b718b59dcdee9291fb68f5c (commit)

commit 2973df0f9b76cac74cd516b05c62f802c2631272
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Nov 29 15:09:00 2009 +0100

    Enable Zoom and Fullscreen with hardware keys on Hildon

 midori/midori-browser.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index f8a0ddf..de1f0e6 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -46,6 +46,8 @@
         "sender='"    MCE_SERVICE     "',"    \
         "path='"      MCE_SIGNAL_PATH "',"    \
         "interface='" MCE_SIGNAL_IF   "'"
+    #include <gdk/gdkx.h>
+    #include <X11/Xatom.h>
 #endif
 
 struct _MidoriBrowser
@@ -4923,10 +4925,18 @@ static const GtkActionEntry entries[] = {
    NULL, "<Ctrl>r",
    N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
  { "ZoomIn", GTK_STOCK_ZOOM_IN,
+   #if HAVE_HILDON
+   NULL, "F7",
+   #else
    NULL, "<Ctrl>plus",
+   #endif
    N_("Increase the zoom level"), G_CALLBACK (_action_zoom_in_activate) },
  { "ZoomOut", GTK_STOCK_ZOOM_OUT,
+   #if HAVE_HILDON
+   NULL, "F8",
+   #else
    NULL, "<Ctrl>minus",
+   #endif
    N_("Decrease the zoom level"), G_CALLBACK (_action_zoom_out_activate) },
  { "ZoomNormal", GTK_STOCK_ZOOM_100,
    NULL, "<Ctrl>0",
@@ -4940,7 +4950,11 @@ static const GtkActionEntry entries[] = {
     N_("View the source code of the selection"),
     NULL/*G_CALLBACK (_action_selection_source_view_activate)*/ },
  { "Fullscreen", GTK_STOCK_FULLSCREEN,
+   #if HAVE_HILDON
+   NULL, "F6",
+   #else
    NULL, "F11",
+   #endif
    N_("Toggle fullscreen view"), G_CALLBACK (_action_fullscreen_activate) },
 
  { "Go", NULL, N_("_Go") },
@@ -5281,6 +5295,15 @@ midori_browser_realize_cb (GtkStyle*      style,
 {
     GdkScreen* screen;
     GtkIconTheme* icon_theme;
+    #ifdef HAVE_HILDON_2_2
+    /* hildon_gtk_window_enable_zoom_keys */
+    guint32 set = 1;
+    gdk_property_change (GTK_WIDGET (browser)->window,
+                         gdk_atom_intern ("_HILDON_ZOOM_KEY_ATOM", FALSE),
+                         gdk_x11_xatom_to_atom (XA_INTEGER),
+                         32, GDK_PROP_MODE_REPLACE,
+                         (const guchar *) &set, 1);
+    #endif
 
     screen = gtk_widget_get_screen (GTK_WIDGET (browser));
     if (screen)



More information about the Xfce4-commits mailing list