]> Dogcows Code - chaz/openbox/blobdiff - openbox/popup.c
super amazing enter event skipping.
[chaz/openbox] / openbox / popup.c
index 156ce8605b9751ee6205aff9bc7bcc892586291e..86d4fb4dec6bd01549542236fa5cb589a281e705 100644 (file)
@@ -154,6 +154,9 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
     gint emptyx, emptyy; /* empty space between elements */
     gint textx, texty, textw, texth;
     gint iconx, icony, iconw, iconh;
+    Rect *area;
+
+    area = screen_physical_area();
 
     RrMargins(self->a_bg, &l, &t, &r, &b);
 
@@ -225,6 +228,9 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
         break;
     }
 
+    x=MAX(MIN(x, area->width-w),0);
+    y=MAX(MIN(y, area->height-h),0);
+    
     /* set the windows/appearances up */
     XMoveResizeWindow(ob_display, self->bg, x, y, w, h);
     RrPaint(self->a_bg, self->bg, w, h);
@@ -259,11 +265,15 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
 void popup_hide(ObPopup *self)
 {
     if (self->mapped) {
+        gulong ignore_start;
+
+        /* kill enter events cause by this unmapping */
+        ignore_start = event_start_ignore_all_enters();
+
         XUnmapWindow(ob_display, self->bg);
         self->mapped = FALSE;
 
-        /* kill enter events cause by this unmapping */
-        event_ignore_queued_enters();
+        event_end_ignore_all_enters(ignore_start);
     } else if (self->delay_mapped) {
         ob_main_loop_timeout_remove(ob_main_loop, popup_show_timeout);
         self->delay_mapped = FALSE;
@@ -318,6 +328,7 @@ void icon_popup_delay_show(ObIconPopup *self, gulong usec,
         self->a_icon->texture[0].type = RR_TEXTURE_RGBA;
         self->a_icon->texture[0].data.rgba.width = icon->width;
         self->a_icon->texture[0].data.rgba.height = icon->height;
+        self->a_icon->texture[0].data.rgba.alpha = 0xff;
         self->a_icon->texture[0].data.rgba.data = icon->data;
     } else
         self->a_icon->texture[0].type = RR_TEXTURE_NONE;
This page took 0.021358 seconds and 4 git commands to generate.