This repository was archived by the owner on Sep 4, 2024. It is now read-only.
[Gtk] Add Popover transparency without alpha support#587
Open
sevoku wants to merge 5 commits into
Open
Conversation
Simulates alpha color support by rendering the Gdk window content behind a popover on its background, if the Gdk screen does not support alpha colors or window opacity.
* Use gdk_cairo_set_source_window() if possible (Gtk+ 2.24+) * Optimize window to pixbuf rendering with Gtk+ < 2.24
On Windows and Mac gdk_cairo_set_source_window() does not work properly.
If the platform has no alpha support and alpha can not be faked, just fill the whole popover with the desired background color and stroke around the whole window.
Member
Author
|
I have tested this on all platforms with all resolutions now. On Mac and Windows we can't use For any non-working case, I've added a fallback which simply fills the whole window: @slluis: I hope this is robust enough now, since I catch all cases that are known to break. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Simulates alpha color support by rendering the Gdk window content behind a popover on its background, if the Gdk screen does not support alpha colors or window opacity.
This is especially relevant on Windows where Gtk has no opacity/alpha color support (and may be triggered on Linux or Mac in rare cases, where i.e. the graphic adapter support is broken or an old Gtk version is being used):
Without Fake Transparency:

With this Patch:

And the fixed Xamarin Android Designer on Windows:
