Commit Graph

807 Commits

Author SHA1 Message Date
Julien Danjou e9794c7cbd key: stop using keybinding_t and sorted array
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>
2009-04-27 16:10:58 +02:00
Julien Danjou 620fde1213 client: remove useless window_configure calls (FS#511)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 11:21:02 +02:00
Julien Danjou dc29720ef7 Replace lua_newtable() with lua_createtable()
Lua can preallocate space in table for array or non-array elements type.
This should improve performance when setting table, so when we can we
use lua_createtable() since this is just a gain.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-25 15:04:27 +02:00
Mariusz Ceier e8de7a4605 Focus stealing prevention - should fix FS#497
We should prevent focus stealing, in case when there are e.g. 2 clients
on separate tags, first client has focus, and we receive FocusIn event
for second (invisible) client.

This patch adds prevention in the focus update handler. It sets focus
on previously focused client, when FocusIn event destination is
invisible(untagged) client.

This should fix FS#497.

Signed-off-by: Mariusz Ceier <mceier@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-23 23:40:46 +02:00
Julien Danjou 4a34693bfb screen: remove index field
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 17:51:31 +02:00
Julien Danjou 0b93186f09 property: make use of xcb_get_wm_class_from_reply() when possible
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 14:20:06 +02:00
Uli Schlachter 99b521b2c7 Rename luaA_pushcolor() to luaA_pushxcolor()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Julien Danjou 80e935455d stack: remove client_node type and inverse order
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>
2009-04-17 23:26:26 +02:00
Julien Danjou f473a107b0 cleanup #includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:52:25 +02:00
Julien Danjou 486ef71a7f screen: replace screens pointer by a screen_t array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:14:09 +02:00
Julien Danjou 9bb2c2d1e9 client: changing size hints does not arrange()
It just calls property hook.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 11:43:56 +02:00
Julien Danjou f4221a1fdf spawn: add support for startup-notification
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-14 14:23:38 +02:00
Julien Danjou e4f7e99c3f client: add support for _NET_STARTUP_ID
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-14 12:47:10 +02:00
Julien Danjou a08794d7cd client, wibox: unref image on garbage collection
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 12:36:23 +02:00
Julien Danjou 4531a3a17c tag: use new Lua object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 5931bf752d wibox: use new Lua object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 81033d391b client: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 541d4f565f image: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Julien Danjou be752cc81c client: change global linked list to an array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Julien Danjou 46ffccd8e2 root: fix fake_input code
This code actually belongs to 'root' since it does not send events to a
client but simply to X.
The window argument is only used in motion event, so fix that also.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 01:55:37 +02:00
Maarten Maathuis f6e4b76845 client: fix luadoc typo, minimize should be minimized
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-11 19:04:28 +02:00
Uli Schlachter 2a6d5d207d client_stack(): Only stack windows once per mainloop
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>
2009-04-10 18:15:48 +02:00
Uli Schlachter 95457c5ab7 Move the definition of globalconf into a header file
Pretty much every single source file needs this struct, so it makes sense to
define it in a common header instead of in every single .c file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 16:32:42 +02:00
Uli Schlachter a076806ce0 Rename LAYER_OUTOFSPACE to LAYER_COUNT
The name LAYER_OUTOFSPACE suggests that this is a real layer on which windows
can be put, but it's only used as an integer which describes the maximum
allowed / used layer.
Therefor, renaming it to LAYER_COUNT and adding a comment which describes this
might make sense.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 13:35:26 +02:00
Julien Danjou e53c77540d client: move window function into window.c
This should light client.c a bit.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-07 15:58:09 +02:00
Mariusz Ceier 904502552f Focus events handlers
- 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>
2009-04-07 15:42:25 +02:00
Julien Danjou 4d6bf949a8 Revert "event: add FocusOut handler"
This reverts commit 31ba962065.
2009-04-06 13:27:53 +02:00
Maarten Maathuis 31ba962065 event: add FocusOut handler
- I don't see why we should guess about what we recieved and whatnot.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-04 16:32:46 +02:00
Julien Danjou 0d6d6c4fa7 client: store class and instance
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-04 13:54:51 +02:00
Julien Danjou eaec928b8c client: remove useless icon_path
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-04 13:02:30 +02:00
Maarten Maathuis 264a81f3fb client: handle struts (a lot) better
- 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>
2009-03-31 09:17:36 +02:00
Alex Cornejo 106e6ed5ab Styling inconsistencies
Cheers,

Alex

From b5816ec55073507d4527ad3a77eae1878adb30d3 Mon Sep 17 00:00:00 2001
From: Alex Cornejo <acornejo@gmail.com>
Date: Sun, 29 Mar 2009 14:24:27 -0400
Subject: [PATCH] Fixed some styling issues.

Noticed in the latest pull that a commit introduced a lot of styling
inconsistencies, decided to remove those and others found by a simple
grep.

Signed-off-by: Alex Cornejo <acornejo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-30 12:53:12 +02:00
Maarten Maathuis 9aeda90738 client: add a "struts" property
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:40:06 +01:00
Maarten Maathuis bf0329d8a3 client: fix typo
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:38:20 +01:00
Maarten Maathuis cf16379778 client: allow special non-transient windows to be !above
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:38:15 +01:00
Maarten Maathuis 68970a3f56 titlebar: redo the handling "a bit"
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:36:35 +01:00
Julien Danjou f0bb0b374b client: export urgent flag manipulation
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-20 08:04:31 +01:00
Julien Danjou 6430738f17 client: stop using otable
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 13:47:50 +01:00
Julien Danjou 84ee8f1f92 event: implements Bob Marley version 2
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>
2009-03-12 11:49:58 +01:00
Julien Danjou 17e2d9e58f client: remove _AWESOME_TAGS property
We use EWMH hints.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou cc2b8f4e89 client: remove useless _AWESOME_FULLSCREEN
We use EWMH hints, it's enough.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou 8745d691fe buttons: change grabbing method
We stop grabbing buttons on root windows. We select button press and
release events, and then we check that we have a bindings for them.
This allow to simply grab buttons on client once, and not redo such
things on arrange or mouse-over-window changes.

Most window managers do like this, anyway.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou 5154cfc19f remove deprecated functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou 9b654095ec client: add Globally Active Input Model (GAIM)
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>
2009-03-03 17:24:40 +01:00
Julien Danjou 9db9abd02a client: remove _AWESOME_FLOATING
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-26 12:35:46 +01:00
Maarten Maathuis c675bf64ec client: fix client_setborder
- Don't know why I didn't do this correctly in the first place :-|

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-20 09:48:34 +01:00
Julien Danjou f711503d7b client: call unfocus hook when we changed focused client (FS#454)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-19 16:27:06 +01:00
Julien Danjou a95fc407b5 client: add .id field
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-18 16:53:42 +01:00
Maarten Maathuis 4f447bcbdc Revert "client: remove a few useless client_need_arrange()."
This reverts commit c9caf05c2d.

- They were not so useless after all, the reason is that before or after setting the new state client_need_arrange() is a no-op.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-17 10:39:43 +01:00
Maarten Maathuis c9caf05c2d client: remove a few useless client_need_arrange().
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-16 10:34:53 +01:00