aboutsummaryrefslogtreecommitdiffstats
path: root/main/xfce4-panel/allow-using-enter.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/xfce4-panel/allow-using-enter.patch')
-rw-r--r--main/xfce4-panel/allow-using-enter.patch193
1 files changed, 193 insertions, 0 deletions
diff --git a/main/xfce4-panel/allow-using-enter.patch b/main/xfce4-panel/allow-using-enter.patch
new file mode 100644
index 0000000000..ee645add30
--- /dev/null
+++ b/main/xfce4-panel/allow-using-enter.patch
@@ -0,0 +1,193 @@
+From 10da325fac243a0b8d6766508b3fc892d605531a Mon Sep 17 00:00:00 2001
+From: Nick Schermer <nick@xfce.org>
+Date: Sun, 07 Nov 2010 19:49:09 +0000
+Subject: Allow using enter in the launcher treeviews.
+
+---
+diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
+index f19e73f..fbb981c 100644
+--- a/plugins/launcher/launcher-dialog.c
++++ b/plugins/launcher/launcher-dialog.c
+@@ -30,6 +30,7 @@
+ #include <garcon/garcon.h>
+ #include <xfconf/xfconf.h>
+ #include <gio/gio.h>
++#include <gdk/gdkkeysyms.h>
+
+ #include <common/panel-private.h>
+ #include <common/panel-utils.h>
+@@ -67,14 +68,16 @@ enum
+
+
+
+-static void launcher_dialog_items_set_item (GtkTreeModel *model,
+- GtkTreeIter *iter,
+- GarconMenuItem *item);
+-static void launcher_dialog_tree_save (LauncherPluginDialog *dialog);
+-static void launcher_dialog_tree_selection_changed (GtkTreeSelection *selection,
+- LauncherPluginDialog *dialog);
+-static void launcher_dialog_items_unload (LauncherPluginDialog *dialog);
+-static void launcher_dialog_items_load (LauncherPluginDialog *dialog);
++static void launcher_dialog_items_set_item (GtkTreeModel *model,
++ GtkTreeIter *iter,
++ GarconMenuItem *item);
++static void launcher_dialog_tree_save (LauncherPluginDialog *dialog);
++static void launcher_dialog_tree_selection_changed (GtkTreeSelection *selection,
++ LauncherPluginDialog *dialog);
++static gboolean launcher_dialog_press_event (LauncherPluginDialog *dialog,
++ const gchar *object_name);
++static void launcher_dialog_items_unload (LauncherPluginDialog *dialog);
++static void launcher_dialog_items_load (LauncherPluginDialog *dialog);
+
+
+
+@@ -297,24 +300,32 @@ launcher_dialog_add_button_press_event (GtkTreeView *treeview,
+ GdkEventButton *event,
+ LauncherPluginDialog *dialog)
+ {
+- GObject *object;
+-
+ panel_return_val_if_fail (GTK_IS_BUILDER (dialog->builder), FALSE);
+ panel_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
+
+- if (event->button == 1 && event->type == GDK_2BUTTON_PRESS
++ if (event->button == 1
++ && event->type == GDK_2BUTTON_PRESS
+ && event->window == gtk_tree_view_get_bin_window (treeview)
+ && gtk_tree_view_get_path_at_pos (treeview, event->x, event->y,
+ NULL, NULL, NULL, NULL))
+- {
+- object = gtk_builder_get_object (dialog->builder, "button-add");
+- panel_return_val_if_fail (GTK_IS_BUTTON (object), FALSE);
+- if (GTK_WIDGET_SENSITIVE (object))
+- {
+- gtk_button_clicked (GTK_BUTTON (object));
+- return TRUE;
+- }
+- }
++ return launcher_dialog_press_event (dialog, "button-add");
++
++ return FALSE;
++}
++
++
++
++static gboolean
++launcher_dialog_add_key_press_event (GtkTreeView *treeview,
++ GdkEventKey *event,
++ LauncherPluginDialog *dialog)
++{
++ panel_return_val_if_fail (GTK_IS_BUILDER (dialog->builder), FALSE);
++ panel_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
++
++ if (event->keyval == GDK_KEY_Return
++ || event->keyval == GDK_KEY_KP_Enter)
++ return launcher_dialog_press_event (dialog, "button-add");
+
+ return FALSE;
+ }
+@@ -517,7 +528,6 @@ launcher_dialog_tree_drag_data_received (GtkWidget *treeview,
+
+
+
+-
+ static void
+ launcher_dialog_tree_selection_changed (GtkTreeSelection *selection,
+ LauncherPluginDialog *dialog)
+@@ -581,12 +591,31 @@ launcher_dialog_tree_selection_changed (GtkTreeSelection *selection,
+
+
+ static gboolean
++launcher_dialog_press_event (LauncherPluginDialog *dialog,
++ const gchar *object_name)
++{
++ GObject *object;
++
++ panel_return_val_if_fail (GTK_IS_BUILDER (dialog->builder), FALSE);
++
++ object = gtk_builder_get_object (dialog->builder, object_name);
++ panel_return_val_if_fail (GTK_IS_BUTTON (object), FALSE);
++ if (GTK_WIDGET_SENSITIVE (object))
++ {
++ gtk_button_clicked (GTK_BUTTON (object));
++ return TRUE;
++ }
++
++ return FALSE;
++}
++
++
++
++static gboolean
+ launcher_dialog_tree_button_press_event (GtkTreeView *treeview,
+ GdkEventButton *event,
+ LauncherPluginDialog *dialog)
+ {
+- GObject *object;
+-
+ panel_return_val_if_fail (GTK_IS_BUILDER (dialog->builder), FALSE);
+ panel_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
+
+@@ -594,15 +623,24 @@ launcher_dialog_tree_button_press_event (GtkTreeView *treeview,
+ && event->window == gtk_tree_view_get_bin_window (treeview)
+ && gtk_tree_view_get_path_at_pos (treeview, event->x, event->y,
+ NULL, NULL, NULL, NULL))
+- {
+- object = gtk_builder_get_object (dialog->builder, "item-edit");
+- panel_return_val_if_fail (GTK_IS_BUTTON (object), FALSE);
+- if (GTK_WIDGET_SENSITIVE (object))
+- {
+- gtk_button_clicked (GTK_BUTTON (object));
+- return TRUE;
+- }
+- }
++ return launcher_dialog_press_event (dialog, "item-edit");
++
++ return FALSE;
++}
++
++
++
++static gboolean
++launcher_dialog_tree_key_press_event (GtkTreeView *treeview,
++ GdkEventKey *event,
++ LauncherPluginDialog *dialog)
++{
++ panel_return_val_if_fail (GTK_IS_BUILDER (dialog->builder), FALSE);
++ panel_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
++
++ if (event->keyval == GDK_KEY_Return
++ || event->keyval == GDK_KEY_KP_Enter)
++ return launcher_dialog_press_event (dialog, "item-edit");
+
+ return FALSE;
+ }
+@@ -991,6 +1029,8 @@ launcher_dialog_show (LauncherPlugin *plugin)
+ launcher_dialog_tree_selection_changed (selection, dialog);
+ g_signal_connect (G_OBJECT (object), "button-press-event",
+ G_CALLBACK (launcher_dialog_tree_button_press_event), dialog);
++ g_signal_connect (G_OBJECT (object), "key-press-event",
++ G_CALLBACK (launcher_dialog_tree_key_press_event), dialog);
+
+ /* connect bindings to the advanced properties */
+ for (i = 0; i < G_N_ELEMENTS (binding_names); i++)
+@@ -1006,7 +1046,7 @@ launcher_dialog_show (LauncherPlugin *plugin)
+ g_signal_connect (G_OBJECT (object), "response",
+ G_CALLBACK (launcher_dialog_add_response), dialog);
+ g_signal_connect (G_OBJECT (object), "delete-event",
+- G_CALLBACK (gtk_true), NULL);
++ G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+
+ /* setup sorting in the add dialog */
+ object = gtk_builder_get_object (builder, "add-store");
+@@ -1025,6 +1065,8 @@ launcher_dialog_show (LauncherPlugin *plugin)
+ G_CALLBACK (launcher_dialog_add_selection_changed), dialog);
+ g_signal_connect (G_OBJECT (object), "button-press-event",
+ G_CALLBACK (launcher_dialog_add_button_press_event), dialog);
++ g_signal_connect (G_OBJECT (object), "key-press-event",
++ G_CALLBACK (launcher_dialog_add_key_press_event), dialog);
+
+ /* setup search filter in the add dialog */
+ object = gtk_builder_get_object (builder, "add-store-filter");
+--
+cgit v0.8.3.4