Commit Graph

65 Commits

Author SHA1 Message Date
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
Uli Schlachter a311ab0679 Don't destroy client windows in unmanage
When a client is unmanaged, we destroy our frame window. But since the client's
own window was still a child of the frame window, it was destroyed, too. This
commit fixes this by reparenting the client's window back to the root window
first.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:40 +02:00
Uli Schlachter 9fbdecf26c Split up client_getbywin()
This splits up client_getbywin() into two different functions. One of them finds
a client by its frame window, the other checks against the client's own window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:29 +02:00
Uli Schlachter 102063dbbd Turn this into a reparenting WM
Each window is now reparented under a window created by awesome. This window is
NOT visible, this commit should not cause any visible differences. Instead, this
is done to work around problems with X11.

The only alternative would be to ban windows by moving them offscreen which is
ugly in itself and breaks pagers. Doing it like this seems to be the better
solution.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 11:56:26 +02:00
Uli Schlachter b64c989963 Stop using libxcb-property
libxcb-property will be dropped from xcb-utils in the next release, because
upstream thinks it's not really useful and well-designed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 16:45:56 +02:00
Uli Schlachter e773eecc03 Remove windows from the save set in unmanage
While a window is in the save set, it will automatically be made visible again
when awesome exits/dies. This makes sure that the next window manager will pick
this window up and handle it properly again.

But when a window explicitly asks not to be visible, it doesn't want to be
visible. Even if awesome dies. So we should remove the client's window from the
save set in client_unmanage.

Thanks to anrxc and his xwrits.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-24 19:44:28 +02:00
Uli Schlachter 5bfe0f69d1 Improve aspect size handling
The window is now no longer enlarged to make it fit into its aspect ratio, but
only ever made lower. This was verified with a small test app that sets a min
aspect ratio of 0.5 and max aspect ratio of 2.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:32:57 +02:00
Uli Schlachter 528747267a Fix some size hint mixups
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:02:06 +02:00
Uli Schlachter 8e5409a2cd Fix a minor ICCCM incompatibility
ICCCM says that the min size should be used for the base size if no base size is
specified. The only exception is when calculating the aspect ratio of the
window, in that case only the "real" base size may be used.

Awesome didn't do this last part before.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:00:23 +02:00
Uli Schlachter 72261c9750 Ignore size hints on fullscreen windows
If a window is fullscreen it is supposed to cover the full screen. Obeying size
hints makes no sense in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-21 17:48:58 +02:00
Uli Schlachter 37703948b3 Avoid some flickering when a new window opens
A new window is by default above all other windows. This means that when we map
it and then *later* move it to the correct place in the stacking order (thanks
to lazy restacking), the window on the top of the stack has to redraw itself.

I noticed this via naughty notifies redrawing themselves after opening a browser
window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-18 14:32:37 +02:00
Uli Schlachter 58f79dca8a Add all managed client windows to the safe set
When an application loses its connection to the X11 server, all the windows in
its save-set are saved by reparenting them back to their closest ancestor. Also,
to they are unconditionally mapped. This second property is exactly what we
need: All windows should be in mapped state, else the next window manager which
starts up won't be managing them.

This should fix all bugs where clients where lost due to a restart, yay! :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:35:06 +02:00
Uli Schlachter 7b65f068a1 Reorder some code for fullscreening windows
When one sets a client to fullscreen, this is what currently happens:
- lua code: c.fullscreen = true
- The C code emits request::fullscreen without having touched the client's
  fullscreen property yet (c.fullscreen is still false)
- awful.ewmh changes the client's geometry to fullscreen via c:geometry()
- This causes property::geometry to be emitted
- awful.layout reacts on this and causes the screen to be re-arranged, undoing
  the fullscreen geometry set in awful.ewmh
- The C code for c.fullscreen = true continues and actually changes the client's
  fullscreen flag

The result of this is that we get a client which thinks it is fullscreen'd
without actually being that.

Fix this by first changing the client's fullscreen property and then emitting
request::fullscreen. Same thing for maximized_{vertical,horizontal}.

Thanks to Jim Pryor for reporting this bug and helping reproducing it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-06-18 18:24:05 +02:00
Julien Danjou 61430f860d ewmh: use client signals to update NET_ACTIVE_WINDOW
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:36:35 +02:00
Julien Danjou f4876b5275 ewmh: use signals to update client hints
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:34 +02:00
Julien Danjou 38edc58097 client: implements maximized and fullscreen requests with Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:29 +02:00
Julien Danjou abd73e4f08 stack: stack_client_* calls stack_windows()
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:16 +02:00
Julien Danjou 4ef5e816ec client: remove internal geometry
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:11 +02:00
Julien Danjou c94f7b6767 window: import border_width property
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:06 +02:00