Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partly fix removal of systray from a wibox #1646

Merged
merged 4 commits into from
Mar 12, 2017

Conversation

psychon
Copy link
Member

@psychon psychon commented Mar 11, 2017

This changes the systray widget, wibox.drawable and the C code to
fix the following bug: When the systray widget is removed from a
drawable without being moved somewhere else, the systray stayed visible.
This was because the systray is not drawn by awesome, but only placed.
When the widget is no longer "drawn", it stays wherever it was placed
last.

This change works by detecting the situation when the systray is
removed. Then, the C code is specifically told to remove the systray
window from the drawable.

Note that this is only a partial fix. This change works correctly when
the widget is removed completely, because it is no longer placed by its
parent widget. However, for example, when you do
wibox.widget.systray().visible = false, the effect is just that the
systray widget gets size 0x0. This is not really visible, but as far as
this change is concerned, the widget is still part of the drawable.

[Should wibox.hierarchy to be changed so that it does not count widgets with width 0 or height 0?]

This adds new code so that we can count how often a specific widget is
visible inside of all widget hierarchies.

Signed-off-by: Uli Schlachter <[email protected]>
This commit changes the systray widget, wibox.drawable and the C code to
fix the following bug: When the systray widget is removed from a
drawable without being moved somewhere else, the systray stayed visible.
This was because the systray is not drawn by awesome, but only placed.
When the widget is no longer "drawn", it stays wherever it was placed
last.

This change works by detecting the situation when the systray is
removed. Then, the C code is specifically told to remove the systray
window from the drawable.

Note that this is only a partial fix. This change works correctly when
the widget is removed completely, because it is no longer placed by its
parent widget. However, for example, when you do
wibox.widget.systray().visible = false, the effect is just that the
systray widget gets size 0x0. This is not really visible, but as far as
this change is concerned, the widget is still part of the drawable.

Signed-off-by: Uli Schlachter <[email protected]>
@codecov
Copy link

codecov bot commented Mar 11, 2017

Codecov Report

Merging #1646 into master will increase coverage by 0.04%.
The diff coverage is 97.01%.

@@            Coverage Diff             @@
##           master    #1646      +/-   ##
==========================================
+ Coverage   81.73%   81.78%   +0.04%     
==========================================
  Files         297      297              
  Lines       18335    18400      +65     
==========================================
+ Hits        14987    15049      +62     
- Misses       3348     3351       +3
Flag Coverage Δ
#functionaltests 63.14% <84%> (+0.02%)
#samples 65.8% <48%> (-0.04%)
#unittests 74.68% <100%> (+0.34%)
Impacted Files Coverage Δ
spec/wibox/test_utils.lua 75.75% <100%> (+0.75%)
lib/wibox/hierarchy.lua 96.75% <100%> (+0.22%)
spec/wibox/hierarchy_spec.lua 98.98% <100%> (+0.25%)
lib/wibox/widget/systray.lua 49.46% <80%> (+1.14%)
lib/wibox/drawable.lua 96.51% <85.71%> (-0.31%)
lib/awful/tooltip.lua 85.59% <0%> (-0.43%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d91d49...64b9649. Read the comment docs.

Widgets with width or height zero cannot really be counted as visible,
so do not do so.

Signed-off-by: Uli Schlachter <[email protected]>
I spent way too much time trying to figure out why setting "visible" to
false did not work...

Signed-off-by: Uli Schlachter <[email protected]>
@Elv13 Elv13 added this to the next: pull requests to be merged soon milestone Mar 12, 2017
@Elv13 Elv13 merged commit 957966d into awesomeWM:master Mar 12, 2017
@psychon psychon deleted the systray_removal branch March 13, 2017 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants