AyatanaIndicators / ayatana-indicator-display

Ayatana Indicator Display
GNU General Public License v3.0
2 stars 7 forks source link

Hide xsct features if not supported by server/driver #101

Closed tari01 closed 4 months ago

tari01 commented 5 months ago

fixes https://github.com/AyatanaIndicators/ayatana-indicator-display/issues/70

sunweaver commented 4 months ago

Took another look. I am not convinved of using bVirtualX everywhere in the code and making the appearance of the sliders depend on the bVirtualX boolean value. There could be tons of reasons to hide those sliders (e.g. desktop envs that don't support xsct such as Budgie), so a generic approach would be:

sunweaver commented 4 months ago

@tari01 Please comment on my other suggestions / requests. Thanks.

tari01 commented 4 months ago

Took another look. I am not convinved of using bVirtualX everywhere in the code and making the appearance of the sliders depend on the bVirtualX boolean value. There could be tons of reasons to hide those sliders (e.g. desktop envs that don't support xsct such as Budgie), so a generic approach would be:

* during indicator initialization, check if we can handle brightness adjustments

* during indicator initialization, check if we can handle colortemp adjustments

* (depending on whatever reasons)

* and then later in the code, check for both feature flags individually, called by a name that describes what it is about

Since the xsct call always succeeds, the only thing we can do is check for e.g. is_budgie and all other known cases where xsct has no effect, and use something like bUnsupported. Because this pull request only fixes the virtual display issue, any further filtering should be added as another issue + fix.

sunweaver commented 4 months ago

Alright then.