Libawn event propagation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Awn |
Fix Released
|
Medium
|
Miika-Petteri Matikainen |
Bug Description
While creating the stack applet, I did not receive the key-press and expose events.
This fixed the problem:
=== modified file 'libawn/
--- libawn/
+++ libawn/
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
#include "awn-applet.h"
#include "awn-applet-
@@ -127,12 +128,13 @@
}
-
+// Should "reposition" dialog-arrow if the dialog does not fit (fall-off-screen)
+// on the desired place.
void
awn_applet_
{
- if (dialog->applet == NULL)
- return;
+ if (dialog->applet == NULL)
+ return;
gint width, height;
GtkWindow *window = GTK_WINDOW (dialog);
@@ -143,11 +145,12 @@
/* offest by applet height */
gtk_widget_
y += height;
+ x += (width / 2) - 36; // gap
/* offset dialog height */
gtk_window_
y -= height;
-
+
gtk_window_move (GTK_WINDOW(
}
@@ -161,8 +164,9 @@
_on_expose_
{
cairo_t *cr = NULL;
+ GtkWidget *child = NULL;
gint width, height;
- const gchar *text;
+ const gchar *text;
cr = gdk_cairo_create (widget->window);
if (!cr)
@@ -212,12 +216,12 @@
// Clean up
cairo_destroy (cr);
- /* Propagate the expose event to the child */
- gtk_container_
- gtk_bin_get_child (GTK_BIN (widget)),
- expose);
-
- return TRUE;
+ /* Propagate the signal */
+ child = gtk_bin_get_child (GTK_BIN (widget));
+ if (child)
+ gtk_container_
+
+ return FALSE;
}
@@ -225,11 +229,11 @@
_on_key_
{
/*printf("is awn applet dialog? %i\n", AWN_IS_
- if (event->keyval == 65307 && AWN_IS_
+ if (event->keyval == GDK_Escape && AWN_IS_
{
AWN_
gtk_
}
- return TRUE;
+ return FALSE;
}
=== modified file 'libawn/
--- libawn/awn-applet.c 2007-07-30 23:21:37 +0000
+++ libawn/awn-applet.c 2007-08-06 09:07:06 +0000
@@ -264,7 +264,7 @@
awn_applet_
{
cairo_t *cr = NULL;
- GtkWidget *child = NULL;
+ GtkWidget *child = NULL;
if (!GDK_IS_DRAWABLE (widget->window))
return FALSE;
@@ -281,10 +281,10 @@
/* Clean up */
cairo_destroy (cr);
- /* Propagate the signal */
- child = gtk_bin_get_child (GTK_BIN (widget));
+ /* Propagate the signal */
+ child = gtk_bin_get_child (GTK_BIN (widget));
if (child)
- gtk_container_
+ gtk_container_
return FALSE;
}
That seems to be patch to solve the issue, miika. Could you please commit it, so that he can keep working on the applet?