diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-meego.c | 99 | ||||
-rw-r--r-- | shell/e-shell-view.c | 14 | ||||
-rw-r--r-- | shell/e-shell-window-actions.c | 7 |
3 files changed, 73 insertions, 47 deletions
diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 70401c1e62..3e1bb8a393 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -37,15 +37,9 @@ void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen) #else void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen) { - GdkAtom wm_win, mob_atom; - Atom dummy_t; - unsigned long dummy_l; - int dummy_i; - GdkScreen *screen; - GdkDisplay *display; Window *wm_window_v = NULL; unsigned char *moblin_string = NULL; - GModule *module; + GModule *module = NULL; /* * Wow - this is unpleasant, but it is hard to link directly * to the X libraries, and we have to use XGetWindowProperty @@ -60,46 +54,56 @@ void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen) *is_meego = *small_screen = FALSE; - if (!gdk_display_get_default ()) - return; - - wm_win = gdk_atom_intern ("_NET_SUPPORTING_WM_CHECK", TRUE); - mob_atom = gdk_atom_intern ("_MOBLIN", TRUE); - if (!wm_win || !mob_atom) - return; - - module = g_module_open (NULL, 0); - if (!module) - return; - g_module_symbol (module, "XFree", (gpointer) &fns.XFree); - g_module_symbol (module, "XGetWindowProperty", - (gpointer) &fns.XGetWindowProperty); - if (!fns.XFree || !fns.XGetWindowProperty) { - fprintf (stderr, "defective X server\n"); - goto exit; - } + moblin_string = (unsigned char *)g_getenv ("EVO_MEEGO"); + if (!moblin_string) { + GdkScreen *screen; + GdkDisplay *display; + GdkAtom wm_win, mob_atom; + Atom dummy_t; + unsigned long dummy_l; + int dummy_i; + + if (!gdk_display_get_default ()) + return; + + wm_win = gdk_atom_intern ("_NET_SUPPORTING_WM_CHECK", TRUE); + mob_atom = gdk_atom_intern ("_MOBLIN", TRUE); + if (!wm_win || !mob_atom) + return; + + module = g_module_open (NULL, 0); + if (!module) + return; + g_module_symbol (module, "XFree", (gpointer) &fns.XFree); + g_module_symbol (module, "XGetWindowProperty", + (gpointer) &fns.XGetWindowProperty); + if (!fns.XFree || !fns.XGetWindowProperty) { + fprintf (stderr, "defective X server\n"); + goto exit; + } - display = gdk_display_get_default (); - screen = gdk_display_get_default_screen (gdk_display_get_default()); + display = gdk_display_get_default (); + screen = gdk_display_get_default_screen (gdk_display_get_default()); - gdk_error_trap_push (); + gdk_error_trap_push (); - /* get the window manager's supporting window */ - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), - GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), - gdk_x11_atom_to_xatom_for_display (display, wm_win), - 0, 1, False, XA_WINDOW, &dummy_t, &dummy_i, - &dummy_l, &dummy_l, (unsigned char **)(&wm_window_v)); + /* get the window manager's supporting window */ + fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), + GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), + gdk_x11_atom_to_xatom_for_display (display, wm_win), + 0, 1, False, XA_WINDOW, &dummy_t, &dummy_i, + &dummy_l, &dummy_l, (unsigned char **)(&wm_window_v)); - /* get the '_Moblin' setting */ - if (wm_window_v && (*wm_window_v != None)) - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), *wm_window_v, - gdk_x11_atom_to_xatom_for_display (display, mob_atom), - 0, 8192, False, XA_STRING, - &dummy_t, &dummy_i, &dummy_l, &dummy_l, - &moblin_string); - - gdk_error_trap_pop (); + /* get the '_Moblin' setting */ + if (wm_window_v && (*wm_window_v != None)) + fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), *wm_window_v, + gdk_x11_atom_to_xatom_for_display (display, mob_atom), + 0, 8192, False, XA_STRING, + &dummy_t, &dummy_i, &dummy_l, &dummy_l, + &moblin_string); + + gdk_error_trap_pop (); + } if (moblin_string) { int i; @@ -123,14 +127,15 @@ void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen) g_strfreev (pair); } g_strfreev (props); - fns.XFree (moblin_string); + if (fns.XFree) + fns.XFree (moblin_string); } exit: if (wm_window_v) - fns.XFree (wm_window_v); - - g_module_close (module); + fns.XFree (wm_window_v); + if (module) + g_module_close (module); } #endif diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 6cae11cb03..77215e73a2 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -659,6 +659,20 @@ shell_view_construct_searchbar (EShellView *shell_view) gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1); + if (e_shell_get_small_screen_mode (shell)) { + GtkWidget *image; + GtkAction *action; + GtkToolItem *item; + + action = e_shell_window_get_action (shell_window, "close-window"); + image = gtk_image_new_from_icon_name ("window-close-hover", + GTK_ICON_SIZE_DIALOG); + item = gtk_tool_button_new (image, gtk_action_get_label (action)); + gtk_widget_set_name (GTK_WIDGET (item), "MeeGoCloseButton"); + gtk_activatable_set_related_action (GTK_ACTIVATABLE (item), action); + gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1); + } + return widget; } diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9b14730c7b..288c4633cc 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1446,6 +1446,13 @@ static GtkActionEntry shell_entries[] = { N_("Close this window"), G_CALLBACK (action_close_cb) }, + { "close-window", + GTK_STOCK_CLOSE, + N_("_Close Window"), + "<Control>w", + N_("Close this window"), + G_CALLBACK (action_close_cb) }, + { "contents", GTK_STOCK_HELP, N_("_Contents"), |