#include "focus_cycle.h"
#include "openbox.h"
#include "window.h"
+#include "event.h"
#include "render/render.h"
#include <X11/Xlib.h>
#include <glib.h>
-#define ICON_SIZE 48
+#define ICON_SIZE 40
#define ICON_HILITE_WIDTH 2
#define ICON_HILITE_MARGIN 1
#define OUTSIDE_BORDER 3
/*! This popup shows a single window */
static ObIconPopup *single_popup;
+static gboolean cycle_iconic_windows;
+static gboolean cycle_all_desktops;
+static gboolean cycle_dock_windows;
+static gboolean cycle_desktop_windows;
+
static gchar *popup_get_name (ObClient *c);
static void popup_setup (ObFocusCyclePopup *p,
- gboolean create_targets,
- gboolean iconic_windows,
- gboolean all_desktops,
- gboolean dock_windows,
- gboolean desktop_windows);
+ gboolean create_targets);
static void popup_render (ObFocusCyclePopup *p,
const ObClient *c);
RrAppearanceFree(popup.a_bg);
}
-static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
- gboolean iconic_windows, gboolean all_desktops,
- gboolean dock_windows, gboolean desktop_windows)
+static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets)
{
gint maxwidth, n;
GList *it;
ObClient *ft = it->data;
if (focus_cycle_target_valid(ft,
- iconic_windows,
- all_desktops,
- dock_windows,
- desktop_windows))
+ cycle_iconic_windows,
+ cycle_all_desktops,
+ cycle_dock_windows,
+ cycle_desktop_windows))
{
gchar *text = popup_get_name(ft);
texth = RrMinHeight(p->a_text);
/* find the height of the dialog */
- h = t + b + (icon_rows * ICON_SIZE) + (OUTSIDE_BORDER + texth);
+ h = t + b + (icon_rows * ICON_SIZE) + (OUTSIDE_BORDER*2 + texth);
/* get the position of the text */
textx = l;
}
/* draw the text */
- p->a_text->texture[0].data.text.justify = RR_JUSTIFY_CENTER;
p->a_text->texture[0].data.text.string = newtarget->text;
p->a_text->surface.parentx = textx;
p->a_text->surface.parenty = texty;
g_assert(c != NULL);
/* do this stuff only when the dialog is first showing */
- if (!popup.mapped)
- popup_setup(&popup, TRUE, iconic_windows, all_desktops,
- dock_windows, desktop_windows);
+ if (!popup.mapped) {
+ cycle_iconic_windows = iconic_windows;
+ cycle_all_desktops = all_desktops;
+ cycle_dock_windows = dock_windows;
+ cycle_desktop_windows = desktop_windows;
+ popup_setup(&popup, TRUE);
+ }
g_assert(popup.targets != NULL);
popup_render(&popup, c);
popup.mapped = FALSE;
+ /* kill enter events cause by this unmapping */
+ event_ignore_all_queued_enters();
+
while(popup.targets) {
ObFocusCyclePopupTarget *t = popup.targets->data;
if (!popup.mapped) {
Rect *a;
- popup_setup(&popup, FALSE, iconic_windows, all_desktops,
- dock_windows, desktop_windows);
+ cycle_iconic_windows = iconic_windows;
+ cycle_all_desktops = all_desktops;
+ cycle_dock_windows = dock_windows;
+ cycle_desktop_windows = desktop_windows;
+ popup_setup(&popup, FALSE);
g_assert(popup.targets == NULL);
/* position the popup */