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 will store the widgets references that the wibox have inside their
environment table, and not in the global registry, avoiding memory leaks.
This should fix FS#771.
Signed-off-by: Julien Danjou <julien@danjou.info>
This changes wibox_t::mouse_over to a proper reference. That way one can't
remove that widget from underneath us which would lead to an unprotected lua error.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
wibox_set_border_color() and luaA_wibox_set_border_width() didn't check if a
wibox really had an associated X11 window before changing this window which
resulted in (silent) errors.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
If you change the .bg of an existing wibox which isn't attached to any screen
yet, then there is no window for which we can update the XCB_CW_BACK_PIXEL.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
After the last patch, after each resize the X server fills the complete wibox
with its background color which means that the widgets will still flicker. This
patch fixes this by setting the wibox' bit gravity to NorthWest.
This means that if a wibox is enlarged, only the new, larger part will be filled
with the wibox' background color and the rest of the wibox' content will be left
intact. With this patch I couldn't see any flickering anymore.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
Currently wiboxes have their background set to "inherit parent pixmap". That
means that each time a wibox is e.g. resized, the X server sets the wibox'
content to the wallpaper and then immediately awesome redraws the wibox with the
proper background. This causes flicker when you e.g. resize clients which have a
titlebar.
With this patch, wiboxes get their proper background color for their "back
pixel" value. Now, instead of showing the wallpaper, the X server will fill the
complete wibox with its background color.
With this patch, the actual widgets will still flicker. Also, if the wibox has a
background image, this image obviously won't be used by the X server and we get
some flicker again. My next patch will address these issues.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>