#include "screen.h"
#include "openbox.h"
#include "client.h"
+#include "group.h"
#include "prop.h"
#include "modkeys.h"
#include "event.h"
self->button[i].width = bw;
self->button[i].height = bh;
RrMinSize(prompt_a_focus, &bw, &bh);
- g_print("button w %d h %d\n", bw, bh);
self->button[i].width = MAX(self->button[i].width, bw);
self->button[i].height = MAX(self->button[i].height, bh);
RrMinSize(prompt_a_press, &bw, &bh);
a->texture[4].data.lineart.x2 = e->width - r - 1;
a->texture[4].data.lineart.y1 = t;
a->texture[4].data.lineart.y2 = e->height - b - 1;
-
- g_print("setting x2 %d\n", e->width - r - 1);
}
static void render_button(ObPrompt *self, ObPromptElement *e)
render_button(self, &self->button[i]);
}
-void prompt_show(ObPrompt *self, ObClient *parent)
+void prompt_show(ObPrompt *self, ObClient *parent, gboolean modal)
{
gint i;
break;
}
- XSetTransientForHint(ob_display, self->super.window,
- (parent ? parent->window : 0));
+ if (parent) {
+ Atom states[1];
+ gint nstates;
+ Window p;
+ XWMHints h;
+
+ if (parent->group) {
+ /* make it transient for the window's group */
+ h.flags = WindowGroupHint;
+ h.window_group = parent->group->leader;
+ p = RootWindow(ob_display, ob_screen);
+ }
+ else {
+ /* make it transient for the window directly */
+ h.flags = 0;
+ p = parent->window;
+ }
+
+ XSetWMHints(ob_display, self->super.window, &h);
+ PROP_SET32(self->super.window, wm_transient_for, window, p);
+
+ states[0] = prop_atoms.net_wm_state_modal;
+ nstates = (modal ? 1 : 0);
+ PROP_SETA32(self->super.window, net_wm_state, atom, states, nstates);
+ }
+ else
+ PROP_ERASE(self->super.window, wm_transient_for);
/* set up the dialog and render it */
prompt_layout(self);
if (e->type != KeyPress) return FALSE;
- g_print("key 0x%x 0x%x\n", e->xkey.keycode, ob_keycode(OB_KEY_TAB));
-
shift_mask = modkeys_key_to_mask(OB_MODKEY_KEY_SHIFT);
shift = !!(e->xkey.state & shift_mask);