Commit Graph

83 Commits

Author SHA1 Message Date
Uli Schlachter dafcc68427 Send correct signals when c.name updates
When a client sets WM_NAME (client->alt_name) but doesn't set _NET_WM_NAME
(client->name), we give alt_name to lua when c.name is used. However, we still
emitted property::alt_name instead of property::name to lua. Obviously, this
breaks stuff.

(The same applies to client->alt_icon_name)

I noticed this via feh whose tasklist entry wasn't refreshed when multiple
images were displayed and I switched to the next one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 17:04:26 +01:00
Uli Schlachter 659d949052 Tag clients more intelligently (FS#700)
Before this commit, c:tags(tags) and t:clients(clients) first removed all
tags/clients and then added the new one.

This is now changed into only removing the tags/clients that have to be removed
and leaving the others in place. Hopefully, this avoids all kinds of weird
issues which we had.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-18 14:21:37 +01:00
Uli Schlachter 6494540b0c Unban clients when they are focused
In commit 3dbf89c I removed a client_unban() in the code path for focusing
clients. The idea was that client focusing is now done after rebanning, so that
it should already be visible by the time this code is executed.

However, minimized clients obviously don't get unbanned, So we have to call
client_unban() here to make sure the client is unminimized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-09 10:44:19 +01:00
Uli Schlachter b9c427d48f Fix another lua stack balance problem
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 15:07:07 +02:00
Uli Schlachter 8b16d1ee4b client_unfocus_update: Merge into client_unfocus
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:59:02 +02:00
Uli Schlachter 3dbf89c990 Lazyle set the input focus (FS#804)
Instead of immediately setting the X11 input focus when client.focus is assigned
something, we now just remember that we'll have to do something later. The focus
is then set in the next prepare call by libev (= after the current main loop run
is done).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:57:14 +02:00
Uli Schlachter f931af7ce1 Rename globalconf.client_focus to focus.client
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:46:56 +02:00
Julien Danjou fe43b99a2a client: remove prev_client_focus
Not sure it's good however.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-10 14:05:52 +02:00
Uli Schlachter af8fd15a8f client_unmanage(): Handle destroyed windows
When we receive a DestroyNotify, we have to unmanage the client. However, we
were just informed that the window was destroyed, so it doesn't make sense to
try to do "something" with the window.

This commits fixes some errors from the X server (which we ignored, but still
they are gone now).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-07 12:05:43 +02:00
Uli Schlachter 6826e5dfc4 Remove globalconf.colors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:01:44 +02:00
Uli Schlachter 5f5787d97b Wibox: Rename to drawin
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:36:02 +02:00
Uli Schlachter aca253420d Make sure we set some required values on windows
All windows which use globalconf.default_depth must also have a backpixel,
borderpixel and colormap set when they are created. Without this, all these
xcb_create_window() calls would fail when globalconf.default_depth is no longer
the screen's default depth.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter dfd95f1f72 Use the new defaults from globalconf
This makes all the code use the default colormap, depth and visual from
globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter 368925beff Remove compatibility to image class
All the APIs that accept both an image and a cairo surface now only accept cairo
surfaces. Images are gone.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:35:59 +02:00
Uli Schlachter 36924247ca client: Use a surface for c:get_content()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 13:19:30 +02:00
Uli Schlachter 146a5dd67c Convert a client's icon to a cairo surface
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 13:18:35 +02:00
Uli Schlachter acc0ca624b Move window type from client_t to window_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-27 21:52:18 +02:00
Uli Schlachter 5b96d66634 client.content: Use p_new() instead of p_alloca() (FS#824)
alloca() allocates stack space. The image that we were producing is possibly
huge which means that we were asking for e.g. 9MiB of stack space. This is not
really a good idea and caused crashes.

Fix this by using heap memory instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-27 11:25:20 +02:00
Uli Schlachter bf3aa6d79e client: Stop using a_tokenize
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-02 19:19:01 +02:00
Uli Schlachter eae3e5b9c4 luaclass properties: Use C strings
This modifies the lua class code to use C strings instead of the tokens
generated via gperf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-01 15:41:41 +02:00
Julien Danjou b5e5d1f2a0 client: emit object signals rather than class ones
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-26 18:15:19 +02:00
Uli Schlachter e0774377ca Sort all signal lists alphabetically
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:46:17 +02:00
Uli Schlachter 8cd4d53877 Add some signals that were previously missing
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:43:24 +02:00
Uli Schlachter ab4c151ed8 Add signals before using them
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 23:00:36 +02:00
Julien Danjou 63e4ba460b client: client_set_focus is static, so merge
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:50:40 +02:00
Julien Danjou 195dac628b client: client_unfocus is static
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:47:01 +02:00
Julien Danjou 80d1a4ea96 client: client_unfocus_update is static
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:46:42 +02:00
Julien Danjou 712234b133 client: use window attribute rather than invalid
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:44:58 +02:00
Julien Danjou bb54142746 client: macrotify property setter
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:39:55 +02:00
Julien Danjou 548e5441b1 ewmh: use client signals to call ewmh_update_net_client_list
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:38:17 +02:00
Uli Schlachter 85c97f45fd Revert "Don't call "focus" hook in client_focus()"
This reverts commit 27f9c0177a.

This commit broke code like the following because reading client.focus would
still return the previously focused client:

awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
2010-08-17 21:33:07 +02:00
Uli Schlachter 28de7741cd Remove globalconf.screen_focus
This moves the appropriate fields for client focus from screen_t to globalconf
since only the first screen's fields were used anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-17 15:52:49 +02:00
Uli Schlachter 3b2f6329a9 Remove an unneeded argument to screen_getbycoord()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:25:12 +02:00
Uli Schlachter 6b2e4352bb Remove globalconf.xinerama_is_active
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:20:45 +02:00
Uli Schlachter 5d35771673 Save the screen in globalconf.
There can only be on xcb_screen_t now, so we can save it in globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:10:58 +02:00
Uli Schlachter 32d9a5b2ab Remove support for zaphod mode
This makes awesome support only a single X11 protocol screen. If you are still
using zaphod mode, you can run multiple instances of awesome on the single
screens, e.g.:

DISPLAY=:1.0 awesome & DISPLAY=:1.1 awesome &

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 13:47:40 +02:00
Uli Schlachter 27f9c0177a Don't call "focus" hook in client_focus()
Later on that call will be done through a FocusIn event.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-15 13:17:07 +02:00
Uli Schlachter ce814b4dbf Use globalconf.timestamp
This makes us use globalconf.timestamp instead of XCB_CURRENT_TIME in the places
where it makes sense.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 14:52:23 +02:00
Uli Schlachter 47caab4580 Always unban a client that we are trying to focus
Previously, if a client had nofocus == true, it wasn't unminimized if sth tried
to focus it. Also, if this client had the WM_TAKE_FOCUS protocol, the focusing
would fail since it's an error to set the input focus to an unviewable window.

For consistency, this also moves the code that sets a client's minimized
property to false into client_unban() since it doesn't make sense to have a
minimized client unbanned (i.e. visible).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 14:32:27 +02:00
Uli Schlachter 544fa215ea Add "focusable" property to client objects
If this property is true, setting "client.focus" to this client might have some
effect. If it is false, setting "client.focus" will be ignored completely.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 13:08:55 +02:00
Uli Schlachter 9fcf6a0a0d Unselect events on our frame window in unmanage
This makes sure that we don't get any events from the activity of
client_unmanage() after this point.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-11 11:57:44 +02:00
Uli Schlachter 87237a197f Get a client's property more intelligently
Previous, there was a round-trip after each request for a property since we
waited for the reply immediately. Instead, it makes a lot more sense to first
send all of the requests and then handle all the replies. This now takes only a
single round-trip for all the properties from client_update_properties().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:54:49 +02:00
Uli Schlachter 84526dd630 Select our events on new after the reparent
Together with the previous commit, this makes us not lose clients across
restarts any more.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:33:08 +02:00
Uli Schlachter 709619b466 Push the property requests down
Instead of calling each property handler with a property reply, it's now up to
the handlers to request the properties.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:04:08 +02:00
Uli Schlachter 2f20494676 Overhaul property handling
For each property we handle, there is now a function which sends a request and
returns the cookie and a second function that takes the cookie and saves the
result in the client_t struct. This should make it possible to improve our
latency later on.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:03:16 +02:00
Uli Schlachter 0eb9363533 Clear our event mask in client_unmanage()
This should fix an actual race condition:
- Client unmaps its window (UnmapNotify for awesome)
- Client maps its window (MapRequest for awesome)
- Due to the UnmapNotify: client_unmanage() runs and reparents the window back
  to the root (ReparentNotify)
- Due to the MapRequest: client_manage() runs
- Due to the ReparentNotify: We call client_unmanage() again and now the
  client's window is lost.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:57:47 +02:00
Uli Schlachter c36ee7fea8 client_unmanage: Update WM_STATE later
According to ICCCM, if a client wants to reuse one of its windows, it has to
wait until the WM updated WM_STATE. This means updating WM_STATE should be the
very last thing we do when unmanaging a window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:57:38 +02:00
Uli Schlachter 1f36a3d4de Obey ICCCM 4.1.5 / 4.2.3
When a window is moved, it should be sent a synthetic ConfigureNotify describing
its new position. This also documents why we send a synthetic event if nothing
was changed in response to a ConfigureRequest.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:50 +02:00
Uli Schlachter a5afa009dc Remove a client window's own border
If a client sets its own border on its window, the results look broken. This was
found via xev by Gregor Best, thanks.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:47 +02:00
Uli Schlachter 719c94d67c Avoid some flickering again
The commit which made awesome a reparenting WM broke the fix from 37703948b3.
Fix this again by stacking the frame window correctly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:44 +02:00