The only real change in here is the first hunk to client.c which needs to
inline client_setfocus(). Nothing else in here should be a 'real' change.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
We now always know a client's WM_PROTOCOLS property without asking the X server.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
That is necessary because key_find() assume we always get one and only
one keybinding for an event, which is wrong, since we can have several.
Signed-off-by: Julien Danjou <julien@danjou.info>
We now use a client_array_t which is more efficient and we reverse the
array order compared to before.
Signed-off-by: Julien Danjou <julien@danjou.info>
I was creating 2000 wiboxes in a loop (don't ask) and creating them took
forever. According to callgrind, there were about 2 million calls to
xcb_configure_window() and most (if not all) of them were from client_stack().
Awesome spent 70% of its cpu time in these client_stack() calls.
client_stack() is O(N^2) on the number of clients (it walks the list of clients
itself twice and each call to client_stack_above() walks the list too) and O(N)
on the number of wiboxes (it walks the wibox list twice). So obviously calls to
it should be rare.
This patch makes client_stack() only set a flag which is later checked. This
should reduce the number of restacks to the bare minimum. With this patch,
neither xcb_configure_window() nor anything else client_stack() related shows
up as having a lot of calls or using much cpu time.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
- We are tracking focus, using FocusIn/FocusOut events handlers, so user
should never be confused about which client has focus
- window_setfocus function generates focus change requests to the X server
- client_focus uses window_setfocus to set input focus
- revert_to when setting input focus set to Parent, compliant with
ICCCM convention ([1])
- DEBUG flag for those who want to debug focus handlers
Most of the changes, are compliant with X11 handbook ([0]), but some
where obtained experimentally.
Kudos to Maarten Maathuis who helped a lot with this.
[0]
http://cgit.freedesktop.org/xorg/doc/xorg-docs/plain/hardcopy/X11/xlib.PS.gz
[1] http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.7
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Mariusz Ceier <mceier@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
- WINDOW_TYPE_DOCK are chosen first.
- Top/Bottom take precedence over Left/Right.
- Struts are automatically updated.
- Automatically avoid overlap with other struts or wibox'es.
Signed-off-by: Julien Danjou <julien@danjou.info>
Version 1 was supposed to store somehow the mouse coordinates to drop
spurious EnterNotify.
Now, we use a simpler way: we just tell the X server we do not want to
receive this events while we are arranging, since we would get spurious
ones.
Signed-off-by: Julien Danjou <julien@danjou.info>
with small fixes, changes:
- client_focus handles case when c==NULL
- don't focus on already focused client
- added window_takefocus function, that sends WM_TAKE_FOCUS client
message. It is needed by GAIM and Locally Active Input Model.
- moved invocation of lua focus hook from client_focus to
client_focus_hook function.
- client_focus has one additional paremeter, sendmessage.
It is used in FocusIn event handler, to disable sending SetInputFocus
and WM_TAKE_FOCUS messages ( to avoid infinite loop )
Signed-off-by: Mariusz Ceier <mceier@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
According to EWMH, the window manager is responsible for removing the
urgent state of a client. Also, this commit adds a new
client_seturgent(client_t *, bool) function to set the urgent state if
needed.
Signed-off-by: Julien Danjou <julien@danjou.info>
here is a little patch which fix the unresizeable window bug. This bug is due
to some windows, like firefox, having XCB_SIZE_HINT_P_MAX_SIZE and
XCB_SIZE_HINT_P_MIN_SIZE on and all related values to 0, which makes
client_isfixed believe that the windows are of fixed size.
Hope this is the right way to fix it. Anyway now you know where this bug comes
from.
Signed-off-by: Julien Danjou <julien@danjou.info>
- From now on clients shall remain mapped for their entire lifetime.
- This should seriously boost tag switching speed with composite active.
- A lesser improvement may be noticed in non-composite situations.
- Titlebars that are set to invisble are still unmapped.
Since it would clutter the implementation and titlebars are cheap to render.
Not to mention that invisible titlebars are pretty rare.
- It's safe to attach titlebars while the client is banned.
- Titlebars are explicitly removed at exit.
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>