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>
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>
Since the last commit, systray windows will automatically be reparented by the
X11 server. This means we no longer have to do this ourselves.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When an X11 client disconnects from the X server, all of its windows are
destroyed. This also means that all the sub-windows of those windows are
destroyed which is not necessary what one wants to happen.
To work around this, X11 has a "save-set". All the windows that are in the
save-set are reparented to their closest ancestor when they would normally be
destroyed. This is just what this code needs. :)
(The windows in the save-set are also mapped when they are saved, dunno if this
hurts here or not)
Signed-off-by: Uli Schlachter <psychon@znc.in>
The tasklist shouldn't care about the tag history or new tags showing up and it
also shouldn't care about tags disappearing on other screens (on the current
screen the tasklist needs to update because the tag might have been selected).
On the other hand, the tasklist really should care about tags being selected and
unselected. This worked before because this causes changes to the focus history.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
This function calls xcb_change_property() with format==32 which means that it is
called with a 32-bit integer. However, on 64-bit machines, sizeof(long) == 64
which means that this code did the wrong thing.
This wasn't noticed before because it only causes a real difference on
big-endian machines.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes sure that an invalid value for this property doesn't cause the client
to have no tag at all. This should be especially useful when one uses dynamic
tags and restarts awesome which causes less tags to exist than before.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>