From 6be85936aea651721419bb789677059ab3cffad8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 17 Feb 2008 17:01:07 +0100 Subject: Add a comment for translators about how to change order of arguments. --- openbox/screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'openbox') diff --git a/openbox/screen.c b/openbox/screen.c index 5201f78a..730b4c24 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -405,6 +405,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); } -- cgit v1.2.3 From 71940dae6fd5673f0c682247216e6c989545bf9e Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 11 Feb 2008 18:06:22 +0100 Subject: Fix some typos in comments. --- openbox/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/event.c b/openbox/event.c index ea249712..2d3ececa 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -855,7 +855,7 @@ static void event_handle_client(ObClient *client, XEvent *e) 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 */ -- cgit v1.2.3 From 58788c781713092c6aa3a4544f8a06cd499ec4fd Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 17 Feb 2008 23:51:18 -0500 Subject: the focus indicator line for prompt buttons wasn't being displayed, since the texture type was no longer being set --- openbox/prompt.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'openbox') diff --git a/openbox/prompt.c b/openbox/prompt.c index b964de29..84fe2d0d 100644 --- a/openbox/prompt.c +++ b/openbox/prompt.c @@ -351,14 +351,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; -- cgit v1.2.3 From 5bfa48dcffec3b00d119d851cb2427a43f80aa7b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 18 Feb 2008 15:55:59 -0500 Subject: Grab key bindings with GrabModeSync, so that if they lead to a keyboard grab, then no keyboard events will be lost between the initial keybinding and the keyboard grab. --- openbox/grab.c | 2 +- openbox/keyboard.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'openbox') diff --git a/openbox/grab.c b/openbox/grab.c index 43e9a815..214666e5 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -222,7 +222,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(ob_display, event_curtime); passive_count = 0; } diff --git a/openbox/keyboard.c b/openbox/keyboard.c index c23d83e6..c318a4cf 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -53,13 +53,13 @@ static void grab_keys(gboolean grab) while (p) { if (p->key) grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), - GrabModeAsync); + GrabModeSync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - RootWindow(ob_display, ob_screen), GrabModeAsync); + RootWindow(ob_display, ob_screen), GrabModeSync); } } @@ -263,6 +263,8 @@ void keyboard_event(ObClient *client, const XEvent *e) } p = p->next_sibling; } + + XAllowEvents(ob_display, AsyncKeyboard, event_curtime); } static void node_rebind(KeyBindingTree *node) -- cgit v1.2.3 From 041d17373e046b5ee6667b10c1492bb518bac097 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 18 Feb 2008 17:12:38 -0500 Subject: Fix button press behaviours. On LeaveNotify, make the button no longer pressed. On MotionNotify, only make it hovered if no button is pressed down. On EnterNotify, make it hovered or pressed as appropriate. This fixes case where you left-click and hold on a button, then right click to open the menu - this used to leave the button in a pressed state. --- openbox/event.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'openbox') diff --git a/openbox/event.c b/openbox/event.c index 2d3ececa..28c13a2a 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -843,6 +843,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: @@ -851,6 +852,10 @@ 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 @@ -868,7 +873,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: @@ -922,31 +927,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); } @@ -977,22 +982,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: @@ -1031,22 +1041,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: -- cgit v1.2.3