Skip to content

Conversation

patrick96
Copy link
Member

@patrick96 patrick96 commented Nov 11, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

Modules that don't produce any output are hidden by the controller (don't have margins or separators).
The tray module should also do that for format = <tray> when there are no icons.

This required the visibility handling to be tied to the module visibility instead of being handled by the renderer. Otherwise, the renderer would hide the tray (because the %{Pt} tag was never sent) and the tray would not unhide when new icons appeared; it can't differentiate between hidden because empty and hidden because the module is hidden by the user (the latter is the reason the renderer does hiding at all).

Fixes #3036

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Modules that don't produce any output are hidden by the controller
(don't have margins or separators).
The tray module should also do that for `format = <tray>` when there are
no icons.

This required the visibility handling to be tied to the module
visibility instead of being handled by the renderer.
Otherwise, the renderer would hide the tray (because the %{Pt} tag was
never sent) and the tray would not unhide when new icons appeared; it
can't differentiate between hidden because empty and hidden because the
module is hidden by the user (the latter is the reason the renderer does
hiding at all).

Fixes polybar#3036
No longer needed since tray visibility is now controlled directly by the
enclosing module
Copy link

codecov bot commented Nov 11, 2023

Codecov Report

Merging #3037 (50628fe) into hotfix/3.7.1 (2471f35) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##           hotfix/3.7.1    #3037   +/-   ##
=============================================
  Coverage         12.69%   12.69%           
=============================================
  Files               160      160           
  Lines             12533    12531    -2     
=============================================
  Hits               1591     1591           
+ Misses            10942    10940    -2     
Flag Coverage Δ
unittests 12.69% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
include/events/signal.hpp 0.00% <ø> (ø)
include/modules/meta/base.hpp 0.00% <ø> (ø)
src/x11/legacy_tray_manager.cpp 0.00% <ø> (ø)
src/x11/tray_manager.cpp 0.00% <0.00%> (ø)
src/components/renderer.cpp 0.00% <0.00%> (ø)
src/modules/tray.cpp 0.00% <0.00%> (ø)

@patrick96 patrick96 marked this pull request as ready for review November 11, 2023 02:48
@patrick96 patrick96 merged commit cbfbba0 into polybar:hotfix/3.7.1 Nov 11, 2023
@patrick96 patrick96 deleted the tray/hide-empty branch November 11, 2023 03:15
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.

1 participant