summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlupine <lupine>2007-01-21 07:52:42 +0000
committerlupine <lupine>2007-01-21 07:52:42 +0000
commit538b361fd2ddc5cf8c15362adb5aa44983cfd212 (patch)
tree9a44d0271de3fd1c75c22a9ff5ad1aece3ecd2e2
parent829cdd74d5e0e5f0824fb03614d2d1612c8ad83a (diff)
downloadberyl-manager-538b361fd2ddc5cf8c15362adb5aa44983cfd212.tar.gz
beryl-manager-538b361fd2ddc5cf8c15362adb5aa44983cfd212.tar.bz2
Address #867
-rw-r--r--src/main.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 68a092f..5eaa13d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -161,6 +161,12 @@ static void usage(const char *programName)
"[-d] [--no-force-window-manager] [--no-force-decorator] "
"[--help] [--version]" "\n"), programName);
}
+
+void startApp(GtkWidget * w, gchar * command)
+{
+ g_spawn_command_line_async(command, NULL);
+}
+
static void signalHandler(int sig)
{
static int suspending = 0;
@@ -467,11 +473,18 @@ gboolean popupClient(GtkWidget * w, GdkEventClient * e, gpointer d)
gboolean buttonUp(GtkWidget * w, GdkEventButton * e, gpointer d)
{
- if (hasMouse)
+ if (hasMouse && e->button == 3)
showMenu(e->button, e->time);
return TRUE;
}
+gboolean buttonDown(GtkWidget * w, GdkEventButton * e, gpointer d)
+{
+ if (hasMouse && e->button == 1 && e->type == 5)
+ startApp(w,"beryl-settings");
+ return TRUE;
+}
+
gboolean enterNotify(GtkWidget * w, GdkEventCrossing * e, gpointer d)
{
hasMouse = TRUE;
@@ -490,11 +503,6 @@ gboolean destroyNotify(GtkWidget * w, GdkEventClient * e, gpointer d)
return TRUE;
}
-void startApp(GtkWidget * w, gchar * command)
-{
- g_spawn_command_line_async(command, NULL);
-}
-
gboolean decoratorSignalled(gint signal)
{
g_warning(_("Decorator caught deadly signal %d"), signal);
@@ -1423,7 +1431,9 @@ void init_widgets()
gtk_container_add(GTK_CONTAINER(mainIcon), evbox);
gtk_container_add(GTK_CONTAINER(evbox), icon);
g_signal_connect(evbox, "button-release-event", G_CALLBACK(buttonUp),
- NULL);
+ NULL);
+ g_signal_connect(evbox, "button-press-event", G_CALLBACK(buttonDown),
+ NULL);
g_signal_connect(evbox, "enter-notify-event", G_CALLBACK(enterNotify),
NULL);
g_signal_connect(evbox, "leave-notify-event", G_CALLBACK(leaveNotify),