My recent refactoring accidentally made the taglist only connect to the signal
for the first screen on which a taglist is created. This commit fixes the code
so that it connects for all screens.
Fixes https://github.com/awesomeWM/awesome/issues/500
Signed-off-by: Uli Schlachter <psychon@znc.in>
The mouse position is saved and restored when focusing another screen
If the target screen has no saved mouse position, the relative position
of the current screen is used
Signed-off-by: lesell_b <lesell_b@epitech.eu>
If someone modifies a cairo surface and then sets the resulting object as the
image of an imagebox, the imagebox needs to redraw. Thus, since surfaces are
modifiable, we cannot assume that nothing changed when the same image is set
multiple times on an imagebox.
However, the dimensions of a surface cannot be changed and thus this does not
need to emit widget::layout_changed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Whenever client.focus == nil, we set the input focus to the root window to
express "nothing has the input focus". However, thanks to the way X11 input
works, this means that whatever is under the mouse cursor gets keyboard input
events. This can easily be reproduced with urxvt and some small addition to the
config to unfocus things.
This commit changes things. Instead of focusing the root window, we create a
special "no focus" window that gets focused if we want nothing to have the
focus.
Closes https://github.com/awesomeWM/awesome/pull/470.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This refactors the env vars for the build matrix:
- add LUANAME
- drop LUALIB
- add LUAINCLUDE for special luajit include dir.
- add LUAROCKS_ARGS for luarocks' `configure --lua-suffix=jit-2.0.0-beta9`.
Closes https://github.com/awesomeWM/awesome/pull/484.
I have no idea why this needs collectgarbage() to be called twice.
On the other hand, I can explain the change in tooltip.lua. Lua 5.2 introduced
"ephermeron tables". This means that in the following sitation, lua 5.2 can
collect the entry from the table, while 5.1 keeps the entry alive, because the
table has a strong reference to the value and that in turn has a strong
reference to the key:
t = setmetatable({}, { __mode = "k"})
do
local k = {}
t[k] = function() print(k) end
end
collectgarbage("collect")
print(next(t, nil))
To handle this incompatibility, this commit just removes the whole indirection
through the module-level variable "data".
Signed-off-by: Uli Schlachter <psychon@znc.in>
Apparently some of the last commits speeds up create_wibox() a lot. This
highlights that this is a bad test: After creating thousands of wiboxes, awesome
needed 15 seconds to draw all of them and in the end some dbus timeout aborted
the test run.
However, it's irrelevant how quickly we can create wibox. The interesting number
is how quickly we can display a new wibox. Thus, this commits changes the code
so that it also measures the time that is needed to update the wibox. This way,
we don't accumulate a huge number of pending repaints and everything's fine.
Some results (but there is nothing to compare this with):
create&draw wibox: 0.0373947 sec/iter ( 28 iters, 1.59 sec for benchmark)
update textclock: 0.00198174 sec/iter (515 iters, 1.937 sec for benchmark)
relayout textclock: 0.000614439 sec/iter (1710 iters, 1.051 sec for benchmark)
redraw textclock: 0.00116882 sec/iter (865 iters, 2.962 sec for benchmark)
tag switch: 0.000705579 sec/iter (1498 iters, 3.703 sec for benchmark)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit does two things: It gets rid of the reference to the layoutbox that
the default config created and it changes the widget dependency cache to not
keep widgets alive unnecessarily.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Again, instead of directly connecting to various signals for updating a
tasklist, this commit changes the code so that there is just a single, global
connections and based on this a weak table with all tasklist instances is used
do the updates.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Similar to what the previous commit does for layoutboxes, this changes the code
for the taglist so that there is only a single, global connection to the various
signals and these update all taglists via weak tables.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of connecting to the needed tag-update-signal again for every layoutbox,
this now just creates a single connection and updates all layoutboxes from here.
A new weak table is used to find the layoutboxes from these callbacks.
Additionally, layoutboxes are now per-screen unique. So even if you try to
create three layoutboxes for screen 1, the code will now always return the same
instance.
This kind-of fixes the leak test for layoutboxes. The problem is that the
default config also creates a layoutbox and adds it to a wibox. Since this is
now the same layoutbox, the test still fails. Just removing the layoutbox-part
from the default config makes this problem go away.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes the textclock-specific part of the test that the previous commit
added.
To fix this, gears.timer.weak_start_new() is used. This function creates a timer
that is automatically stopped when its callback function is garbage collected.
The callback function is saved as a member of the texbox widget that is the
"widget behind the textclock". Thus, the timer can only be stopped after the
widget is garbage-collected, but the timer does not keep the widget alive.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a client is not visible, this would adjust its stacking order
still.
This also addresses https://github.com/awesomeWM/awesome/issues/472,
because it raises unminimized clients after they got focused.
This function updates a hierarchy if the layout of some widgets changed. It does
nothing on the parts that did not change. This should be more efficient than
recomputing the whole hierarchy whenever something changes.
Once again, this has some positive results on the "benchmark test":
Before:
create wibox: 0.083016 sec/iter ( 13 iters, 1.161 sec for benchmark)
update textclock: 0.00391091 sec/iter (271 iters, 3.219 sec for benchmark)
relayout textclock: 0.00273234 sec/iter (397 iters, 1.087 sec for benchmark)
redraw textclock: 0.0010191 sec/iter (989 iters, 1.745 sec for benchmark)
After:
create wibox: 0.083146 sec/iter ( 13 iters, 1.163 sec for benchmark)
update textclock: 0.00170519 sec/iter (647 iters, 2.201 sec for benchmark)
relayout textclock: 0.000581637 sec/iter (1880 iters, 1.094 sec for benchmark)
redraw textclock: 0.0010167 sec/iter (997 iters, 1.773 sec for benchmark)
So again no difference for creating wiboxes (100.16% compared to before). This
time we also have no real difference for creating wiboxes (99.76%). Update (44%)
and relayout (21%) are improved a lot.
Closes https://github.com/awesomeWM/awesome/pull/463.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the textbox' :draw() and :fit() callbacks use the DPI that is
specified in the given drawing context. With this, the textbox now scales
correctly if different screens have different DPI values.
Idea originally from Daniel.
Closes https://github.com/awesomeWM/awesome/pull/457.
Signed-off-by: Uli Schlachter <psychon@znc.in>