The last commit moved the handling of floating wiboxes into its own function,
so the checks for floating wiboxes in here can be removed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Floating wiboxes are much easier to handle, so they deserve their own
function.
This function, wibox_position_update_floating() does exactly the same things
wibox_position_update() did before. No behaviour change involved.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This is a new version of 'titlebar.lua'. There are now additional buttons for:
- setting the 'ontop' attribute
- setting the 'sticky' attribute
- maximizing the client
In addition to changing the state of the client the buttons also show if the
corresponding state is active for a client. All new buttons now require 4
images for:
- unfocused window, state inactive (i.e. ontop == false)
- unfocused window, state active (i.e. ontop == true)
- focused window, state inactive (i.e. ontop == false)
- focused window, state active (i.e. ontop == true)
It's not difficult to add more buttons with any kind of functionality. User
configuration is currently restricted to theming of the buttons. Buttons are
disabled simply by not configuring them in the theme. The icons for the new
buttons are taken from kde4. They're not really pretty but they're OK to
demonstrate the new features.
Signed-off-by: Julien Danjou <julien@danjou.info>
This code actually belongs to 'root' since it does not send events to a
client but simply to X.
The window argument is only used in motion event, so fix that also.
Signed-off-by: Julien Danjou <julien@danjou.info>
This moves the call to wibox_draw() into wibox_map() which fixes garbage
being displayed if a wibox is made visible by setting its .visible.
Since wibox_draw() already calls simplewindow_refresh_pixmap(), that call is
dropped. Because wibox_need_update() just makes sure wibox_draw() is later
called, we can replace the call to wibox_draw() by this call. This should avoid
superflous updates.
Found by lua code like this:
local w = wibox({ position = "floating", bg = "#ff0000" })
w.visible = false
w.screen = 1
<do some other stuff>
w.visible = true
Signed-off-by: Uli Schlachter <psychon@znc.in>
This moves some common code into a helper function to reduce code
duplication and open-coding that function all the time.
This commit doesn't cause any behaviour change at all.
Signed-off-by: Uli Schlachter <psychon@znc.in>
For a floating wibox which isn't visible, all what wibox_position_update()
does is setting the geometry fields in the simplewindow struct. Since the next
thing luaA_wibox_new() does is setting the wibox' geometry, this call makes
no sense.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If a wibox's screen is set to nil, this is reflected by setting the screen
struct member to SCREEN_UNDEF.
SCREEN_UNDEF is defined as -1. If we allow such a wibox in
wibox_position_update(), bad things will happen (globalconf.screens[-1]).
Signed-off-by: Uli Schlachter <psychon@znc.in>