diff options
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/event.c | 29 | ||||
| -rw-r--r-- | openbox/grab.c | 2 | ||||
| -rw-r--r-- | openbox/keyboard.c | 6 | ||||
| -rw-r--r-- | openbox/prompt.c | 10 | ||||
| -rw-r--r-- | openbox/screen.c | 4 |
5 files changed, 34 insertions, 17 deletions
diff --git a/openbox/event.c b/openbox/event.c index 9502edf5..12c0edcf 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -848,6 +848,7 @@ static void event_handle_client(ObClient *client, XEvent *e) ObFrameContext con; static gint px = -1, py = -1; static guint pb = 0; + static ObFrameContext pcon = OB_FRAME_CONTEXT_NONE; switch (e->type) { case ButtonPress: @@ -856,11 +857,15 @@ static void event_handle_client(ObClient *client, XEvent *e) pb = e->xbutton.button; px = e->xbutton.x; py = e->xbutton.y; + + pcon = frame_context(client, e->xbutton.window, px, py); + pcon = mouse_button_frame_context(pcon, e->xbutton.button, + e->xbutton.state); } case ButtonRelease: /* Wheel buttons don't draw because they are an instant click, so it is a waste of resources to go drawing it. - if the user is doing an intereactive thing, or has a menu open then + if the user is doing an interactive thing, or has a menu open then the mouse is grabbed (possibly) and if we get these events we don't want to deal with them */ @@ -873,7 +878,7 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xbutton.state); if (e->type == ButtonRelease && e->xbutton.button == pb) - pb = 0, px = py = -1; + pb = 0, px = py = -1, pcon = OB_FRAME_CONTEXT_NONE; switch (con) { case OB_FRAME_CONTEXT_MAXIMIZE: @@ -927,31 +932,31 @@ static void event_handle_client(ObClient *client, XEvent *e) } break; case OB_FRAME_CONTEXT_MAXIMIZE: - if (!client->frame->max_hover) { + if (!client->frame->max_hover && !pb) { client->frame->max_hover = TRUE; frame_adjust_state(client->frame); } break; case OB_FRAME_CONTEXT_ALLDESKTOPS: - if (!client->frame->desk_hover) { + if (!client->frame->desk_hover && !pb) { client->frame->desk_hover = TRUE; frame_adjust_state(client->frame); } break; case OB_FRAME_CONTEXT_SHADE: - if (!client->frame->shade_hover) { + if (!client->frame->shade_hover && !pb) { client->frame->shade_hover = TRUE; frame_adjust_state(client->frame); } break; case OB_FRAME_CONTEXT_ICONIFY: - if (!client->frame->iconify_hover) { + if (!client->frame->iconify_hover && !pb) { client->frame->iconify_hover = TRUE; frame_adjust_state(client->frame); } break; case OB_FRAME_CONTEXT_CLOSE: - if (!client->frame->close_hover) { + if (!client->frame->close_hover && !pb) { client->frame->close_hover = TRUE; frame_adjust_state(client->frame); } @@ -982,22 +987,27 @@ static void event_handle_client(ObClient *client, XEvent *e) break; case OB_FRAME_CONTEXT_MAXIMIZE: client->frame->max_hover = FALSE; + client->frame->max_press = FALSE; frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_ALLDESKTOPS: client->frame->desk_hover = FALSE; + client->frame->desk_press = FALSE; frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_SHADE: client->frame->shade_hover = FALSE; + client->frame->shade_press = FALSE; frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_ICONIFY: client->frame->iconify_hover = FALSE; + client->frame->iconify_press = FALSE; frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_CLOSE: client->frame->close_hover = FALSE; + client->frame->close_press = FALSE; frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_FRAME: @@ -1036,22 +1046,27 @@ static void event_handle_client(ObClient *client, XEvent *e) switch (con) { case OB_FRAME_CONTEXT_MAXIMIZE: client->frame->max_hover = TRUE; + client->frame->max_press = (con == pcon); frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_ALLDESKTOPS: client->frame->desk_hover = TRUE; + client->frame->desk_press = (con == pcon); frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_SHADE: client->frame->shade_hover = TRUE; + client->frame->shade_press = (con == pcon); frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_ICONIFY: client->frame->iconify_hover = TRUE; + client->frame->iconify_press = (con == pcon); frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_CLOSE: client->frame->close_hover = TRUE; + client->frame->close_press = (con == pcon); frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_FRAME: diff --git a/openbox/grab.c b/openbox/grab.c index 522fbf96..e797e44c 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -221,7 +221,7 @@ void ungrab_passive_key(void) { /*ob_debug("ungrabbing %d passive grabs\n", passive_count);*/ if (passive_count) { - /* kill out passive grab */ + /* kill our passive grab */ XUngrabKeyboard(obt_display, event_curtime); passive_count = 0; } diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 02ae6a30..5ac42363 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -51,13 +51,13 @@ static void grab_keys(gboolean grab) while (p) { if (p->key) grab_key(p->key, p->state, obt_root(ob_screen), - GrabModeAsync); + GrabModeSync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - obt_root(ob_screen), GrabModeAsync); + obt_root(ob_screen), GrabModeSync); } } @@ -261,6 +261,8 @@ void keyboard_event(ObClient *client, const XEvent *e) } p = p->next_sibling; } + + XAllowEvents(obt_display, AsyncKeyboard, event_curtime); } static void node_rebind(KeyBindingTree *node) diff --git a/openbox/prompt.c b/openbox/prompt.c index 3328a1b2..df36c8c3 100644 --- a/openbox/prompt.c +++ b/openbox/prompt.c @@ -349,14 +349,10 @@ static void prompt_resize(ObPrompt *self, gint w, gint h) static void setup_button_focus_tex(ObPromptElement *e, RrAppearance *a, gboolean on) { - gint l, r, t, b; - - if (!on) { - gint i; + gint i, l, r, t, b; - for (i = 1; i < 5; ++i) - a->texture[i].type = on ? RR_TEXTURE_LINE_ART : RR_TEXTURE_NONE; - } + for (i = 1; i < 5; ++i) + a->texture[i].type = on ? RR_TEXTURE_LINE_ART : RR_TEXTURE_NONE; if (!on) return; diff --git a/openbox/screen.c b/openbox/screen.c index 90f8b27c..773cb75f 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -394,6 +394,10 @@ void screen_startup(gboolean reconfig) NET_NUMBER_OF_DESKTOPS, CARDINAL, &d)) { if (d != config_desktops_num) { + /* TRANSLATORS: If you need to specify a different order of the + arguments, you can use %1$d for the first one and %2$d for the + second one. For example, + "The current session has %2$d desktops, but Openbox is configured for %1$d ..." */ g_warning(_("Openbox is configured for %d desktops, but the current session has %d. Overriding the Openbox configuration."), config_desktops_num, d); } |
