Since commit 3c40d6b, the passed in argument is decomposed into an array of
strings before the sn-related code runs. This means we already know argv[0] and
thus we don't need the code here that tries to figure it out again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, any not-string-convertible entry in the array argument would result
in lua_tostring() returning NULL which g_strdup() would pass through. Thus, we
would end up with a NULL entry in an array whose end is marked with a NULL
entry. This mainly means that we had a memory leak.
Fix this by actually verifying that we only have strings in the table that we
are looking at.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When e.g. calling awesome.spawn({}), our argv array would be empty, so just a
pointer to a NULL pointer that marks the end of the array.
Since startup notification was enabled, this would then try to figure out the
name of the started binary. This would immediately dereference a NULL pointer
and crash.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Pressing CTRL+DELETE removes the visible history entry, if any, then moves to the next history entry (like pressing DOWN would do).
If the last history entry is removed the previous one is shown in the prompt (like pressing UP would do).
CTRL+DELETE works on history entries only: i.e. it has no effect on a command entered but not executed yet.
To implement above behaviour I added saving history table to file on Escape key press.
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of having the C code mess with which tags are selected, we now emit a
signal on the tag that says that something requested it to be selected. Lua can
then handle this by only switching tags on the correct monitor and by updating
the focus history correctly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit a54636751b.
We now have the new xproperty API which does the same thing in a much nicer way.
Thanks to Elv13 for the idea!
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commits adds awesome.register_xproperty(). This allows lua code to register
arbitrary X11 properties with awesome which will then watch these properties.
Whenever such a property is changed on a client or drawin, we will emit the
xproperty::name signal.
This also adds window:get_xproperty(name) and window:set_xproperty(name, value)
which allows to mess with properties.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Ever since commit 6b2e4352b (from 2010!), awesome.spawn() doesn't have a screen
argument anymore and the extra argument from util.spawn was just ignored. Fix
the code and the luadoc for these functions.
Thanks to blueyed for noticing this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
First, we reset the signal handler back to the default one when a fatal signal
is received. This should make sure that we never get into an endless loop where
the signal handler causes the signal to happen again.
Then this commit also makes awesome print a backtrace on more signals than
before. Crashing with a backtrace is always better than without. ;-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes awesome measure how long all the event handling takes. That
is, this measure the time between waking up from poll and going to sleep again.
If that time is above 0.1 seconds, we print a warning and increase the limit for
this warning to the last duration to avoid flooding messages.
This should help figuring out cases were people do stupid things in their
config, like synchronously contacting an IMAP server and getting the number of
unread mails.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit 20afb26080.
The commit caused endless loops with tracebacks like this (shortened):
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
Turns out that my rant about "we can't query the pixmap's values" was wrong.
This commit makes awesome use a GetGeometry request to get the properties of the
(old) root window's back pixmap.
This also converts code to p_delete() instead of free() for consistency. Bad me
for doing multiple things in one commit...
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a client's geometry changes (and I consider the border width to be part of
the geometry here) and that client is one of fullscreen or
maximized_{horizontally,vertically}, make sure that the geometry as specified by
the state is still obeyed.
This also (accidentally) fixes things when a client gets moved to another
screen!
Signed-off-by: Uli Schlachter <psychon@znc.in>
Due to a copy&paste error, maximized_vertical and maximized_horizontal were
handled the same. Of course, vertical and horizontal aren't the same direction.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When we receive a _NET_ACTIVE_WINDOW request on the root window, we used to just
focus and raise the window. This didn't do much for clients which are on
non-selected tags.
Thus, this commit makes awesome emit request::activate on the client instead.
This is used in awful.ewmh to implement the old behavior again, but with
additionally marking the client as urgent if it isn't visible.
People who don't like this behavior can use client.disconnect_signal to disable
this behavior again. To make this really possible, awful.ewmh becomes a
"non-nil" module.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We detect other WMs when we fail to request SubstructureRedirect on the root
window. Previously, the code used an unchecked request and then tried to
cleverly detect if an error occurred. This isn't needed.
Instead, we now use a checked request and use xcb_request_check() to see if any
errors were generated. This also gets rid of a round-trip to the server (one is
still implicitly done by xcb_request_check()).
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the drawable paint the wallpaper in the background
(i.e. pseudo transparency) only if there is not a composite manager running,
as reported by the value of awesome.composite_manager_running.
In other words: drawables can now make use of true transparency.
Signed-off-by: Björn Åström <bjoast@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The default value for the second argument to :find() is 1, so nothing is changed
here. The third arguments disables pattern matching and instead gets us literal
interpretation of strings. This means that pattern characters like e.g. [, ] and
. don't get interpreted.
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
When an area is split in two, for example horizontally, one of the windows
should have height math.floor(previous height / 2) and the other
math.ceil(previous height / 2), to be certain that no gaps are left between the
windows.
For instance, if the first window has height h and the second window has height
math.floor(h / 2), the height of the third window should be math.ceil(h / 2)
instead of the same as for the second window.
So to compute the size of window n + 1 it’s necessary to remember the size of
window n - 1 as well as that of window n.
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a :set_color() method so that the margin layout can color the margins,
drawing a bordered widget.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This gets rid of the unused first argument and adds a new second argument that
can influence individual items.
Signed-off-by: Uli Schlachter <psychon@znc.in>
A drawin's and a client's bounding and clip shape can now be queried and is
returned as a cairo surface. Also, a client window's shape (e.g. xeyes setting
its own shape) can be queried via c.shape_client_bounding and
c.shape_client_clip. All of these properties now emit signals when changed.
(This also silently fixes a bug in luaA_drawin_set_shape_bounding() which forgot
to include the drawin's border in its size calculation)
Signed-off-by: Uli Schlachter <psychon@znc.in>
The documentation says that screen, the last argument to viewmore(), is an
optional argument. However, the implementation only treated it as an optional
argument in one place.
Fix this by always setting the screen variable itself to a screen.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Label of menu entries will be escaped automatically. Doing it manually
in menu:clients() will escape it it twice.
Patch removes the util.escape() call in menu:clients()
Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The activated property was added to tag objects between awesome 3.4 and 3.5.
This is used in the C code to keep tags alive even when nothing else refers to
it and includes a tag e.g. in some root window properties.
Thus, to get rid of a tag and to make the C code drop its reference to it, we
have to set activated to false in this function.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The code in property_update_wm_transient_for() looked at the transient_for
relation before the new transient got set. However, the code is supposed to
check if we get a loop after introducing this new transient_for.
Thus, if we arrive back at the client that we started from, we can be sure that
there is a cycle. Signal this by setting the loop counter high enough to abort
the loop and make the rest of this function do nothing.
No idea how I missed this case before nor why I cannot reproduce this on debian,
but can reproduce it on Arch just fine.
Reported-By: Kasimir Knallkopf at http://article.gmane.org/gmane.comp.window-managers.awesome/10415
Signed-off-by: Uli Schlachter <psychon@znc.in>
In case loading the theme failed and we don't have fg_normal or bg_normal, add
default values for these properties. All the other colors are only used if they
are defined, but these two always need to be defined.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When awesome restarts because a new screen was added or removed, clients can end
up being on a different screen than before the restart. However, the tags will
be carried across the restart. This means that a client could end up being
tagged with a tag from another screen. This results in weird behavior of tag
switches and confuses users.
To work around this, remove the client from any tags that are on a different
screen during startup. If the client ends up without any tags, it will then be
tagged with the currently selected tags.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The above-mentioned bug report says that a window cannot be moved via its
titlebar if you move the move quickly while clicking.
The reason for this was awesome's "event compression": We don't handle all
MotionNotify events, because they can come in big quantities. Instead, we only
want to handle the latest one and ignore all earlier ones (the mouse isn't in
that position anymore anyway).
The problem now appears if a MotionNotify is moved across a ButtonPress event
and the ButtonPress is what should cause the window to be moved. Awesome first
handles the ButtonPress event normally and starts grabbing mouse input. Then,
our event loop feeds us with an old MotionNotify event in which the button was
not pressed yet. The code for moving clients gets a motion event in which no
mouse button is pressed, concludes that the move is done and ungrabs the mouse
again, even though the button is still physically pressed.
Fix this by making sure that MotionNotify events are never moved across
ButtonPress or ButtonRelease events. We already did this for EnterNotify and
LeaveNotify events for similar reasons.
Signed-off-by: Uli Schlachter <psychon@znc.in>