summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr>2007-01-28 16:31:07 +0000
committerracarr <racarr>2007-01-28 16:31:07 +0000
commita684b43e025aeb14f4d4f11794f5389409a8b26f (patch)
tree27a769d074a89e406b579925d019b2be8566a82a
parent5ac8b364866ab0ccd144fcaf77fa1c5bf43ef3e9 (diff)
downloadberyl-desktop-manager-a684b43e025aeb14f4d4f11794f5389409a8b26f.tar.gz
beryl-desktop-manager-a684b43e025aeb14f4d4f11794f5389409a8b26f.tar.bz2
Button press event changes, just testing, it currently segfaults
-rw-r--r--src/bdm.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/bdm.c b/src/bdm.c
index 6498716..02b2693 100644
--- a/src/bdm.c
+++ b/src/bdm.c
@@ -68,10 +68,32 @@ static void on_alpha_screen_changed(GtkWidget * widget, GdkScreen * pOldScreen,
gtk_widget_set_colormap(widget,pColormap);
}
+gboolean on_button_press(GtkWidget *widget, GdkEventButton *button, GdkWindowEdge edge, ScreenArea * area)
+{
+ if (button->type = GDK_BUTTON_PRESS)
+ {
+ if (button->button ==1)
+ {
+ if ( (area->alpha + .05f) <= 1.0f)
+ {
+ area->alpha += .05f;
+ }
+ }
+ else if (button->button == 2)
+ {
+ if (area->alpha > .05f)
+ {
+ area->alpha -= .05;
+ }
+ }
+
+ }
+ return TRUE;
+}
+
gboolean on_key_press(GtkWidget * pWidget, GdkEventKey *pKey, ScreenArea * userData)
{
- //userData->alpha = 0.5;
- //render(userData);
+ // We could do stuff here
}
int main(int argc, char * argv[])
@@ -209,10 +231,9 @@ int main(int argc, char * argv[])
gtk_widget_set_app_paintable(dwindow, TRUE);
gtk_window_set_keep_below(GTK_WINDOW(dwindow),TRUE);
g_signal_connect( G_OBJECT(dwindow),"expose-event",G_CALLBACK(on_alpha_window_expose),sa);
-
- g_signal_connect(G_OBJECT(dwindow),"key-press-event",G_CALLBACK(on_key_press),sa);
- gtk_widget_add_events(G_OBJECT(dwindow), GDK_ALL_EVENTS_MASK);
+ g_signal_connect(G_OBJECT(dwindow),"button-press-event",G_CALLBACK(on_button_press),sa);
gtk_widget_show(dwindow);
+ gtk_widget_add_events(G_OBJECT(dwindow), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
on_alpha_window_expose(dwindow,0,sa);
}
}