We got XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY on the root window, but we also have
XCB_EVENT_MASK_STRUCTURE_NOTIFY on the individual client windows. Since we are
reparenting our windows, we can safely ignore all UnmapNotifies that we get
through the root window.
This fixes a bug if there were any windows already present before awesome
started. Those were obviously already mapped which means that ReparentWindow
would cause an UnmapNotify for them on the root window. This commit makes us
ignore that UnmapNotify and thus not throwing away the window immediately again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since each handler is only for one single atom, there is no point in passing the
atom that was changed to the callback.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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>
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>
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>
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>
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>
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>
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>
ICCCM mandates that window managers have to trigger the conversion to withdrawn
state on the synthetic and the real unmap notify, no matter if any is missing.
Previously we couldn't do this, but thanks to the reparenting, we can now do
this properly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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>
Awesome is built with -Wno-unused-parameter which means there is no point in
explicitly marking arguments as unused.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We no longer use libxcb-event, so we don't have to follow it's API any more.
This means the pointless arguments and return values can be removed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Upstream removed most of the code from libxcb-event and there is no
event-related stuff left in this library. We now no longer use any of the parts
that were removed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We no longer have to follow libxcb-property's API for these function, so we can
remove arguments which we don't use anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
This makes awesome prefetch some of the data it needs during startup to avoid
some useless round-trips to the server.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, if setting the textbox's text failed this caused more problems later
on. This commit makes sure that an invalid text never breaks pango.
Signed-off-by: Uli Schlachter <psychon@znc.in>
ewmh_process_state_atom() does a luaA_object_push() at its beginning, but it
doesn't pop that object again. Fix this by, well, popping the object at the end
of the function again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
tag.delete(t, fb):
Delete tags if certain criteria are met:
- There are no clients assigned exclusively to this tag.
- Stickied clients have somewhere to go, 'fb' the fallback tag
If after deleting there is no tag selected then try and
history.restore() or select the first tag on the screen.
Return true if successful and nil otherwise.
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Ignas Anikevicius <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, the bottom-most window in the stacking order would cause an error
because we tried to stack it above it's sibling XCB_NONE. This was invalid. That
X11 error didn't hurt, but it does look weird. Fix this by not issuing that
invalid ConfigureWindow request.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commits makes awesome remove systray windows from the save set when they
are unmapped. This happens for the same reason as with normal client windows.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
While calculating if part of the window is outside the visible region, this code
should also add the border width. (FS#684)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fullscreen windows should only get their own layer when they have the input
focus. When they are unfocused they should be treated normally (FS#560).
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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>
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>
This commit makes awesome ignore the screen geometry provided by Xrandr if it
only defines a single screen. This should work around nvidia's binary driver
which only provides useful data via Xinerama.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This splits up screen_scan() into screen_scan_randr(), screen_scan_xinerama()
and screen_scan_x11(). These function try to set up screens via RANDR, Xinerama
and the classic core protcol setup.
No code in these functions was actually changed, only some indentation was
changed (and a "return true/false" added to the first two functions).
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
When a wibox is destroyed or detached from a screen, it is wiped to clean up its
resources. This also includes destroying the window which is associated with the
wibox.
The problem here is that if the wibox contains the systray, the systray window
would automatically be destroyed since all childs of a window are destroyed when
said window is destroyed. To fix this, we kick out the systray window before
destroying the wibox' window.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Next commit will need this function and I wanted to make it clearer that no
changes where done to this function.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes a bug where pango was called with already-freed arguments because
wipe() didn't zero out those variables and a later init() failed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, an invalid markup caused an empty popup. Since the C core now throws
a lua error on invalid markup, we have a way to notice that something is wrong.
This patch first tries to set the notification's text the same way we did
previously. If that fails, everything is escaped and the result is used as the
text for the notification.
Thanks to farhaven/Gregor Best for the initial version of this and for the
string.gsub() call I stole from him. :)
Signed-off-by: Uli Schlachter <psychon@znc.in>
luaA_loadrc() now returns a failure when executing the config file causes an
error.
Previously it returned a success which meant the next config file wasn't tried.
Signed-off-by: Uli Schlachter <psychon@znc.in>