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

window-actor: override Clutter opacity property and method #449

Merged
merged 11 commits into from Apr 5, 2019
Merged

window-actor: override Clutter opacity property and method #449

merged 11 commits into from Apr 5, 2019

Conversation

jaszhix
Copy link
Contributor

@jaszhix jaszhix commented Mar 28, 2019

This restores actor opacity management without relying on a signal.

Ref linuxmint/cinnamon#8454

@clefebvre
Copy link
Member

I'm confused, I thought this was already fixed in 448? I can modify window opacity with the mouse wheel on the titlebar here on master... 448 fixed that.

@jaszhix
Copy link
Contributor Author

jaszhix commented Mar 29, 2019

No, it doesn't fix that, it just doesn't regress it like #437 (or reverted commits?) does - as discussed on Slack.

This fixes opacity during effects. From @itzexor in linuxmint/cinnamon#8454:

simple test case:

  • WinKey + E to open nemo, WinKey + L to open melange
  • in melange start inspector and click the nemo window
  • evaluate r(#).opacity = 127 where # is the result number of the nemo window inspection

This restores actor opacity management without relying on a signal.
These separate counters were needed before effects composition was moved
to Cinnamon. Since meta_window_actor_effects_in_progress will return
true if any of the counters are greater than 1, they can be combined
into one. This allows us to kill meta_window_actor_effects_in_progress,
which is called during a lot of window operations.

The only other use for separate counters is distinguishing the effect
during debugging, but since this is a dev feature, we might as well just
pass the event number, and it can be looked up in the rare event the
effects counter is less than 0.
This was part of a local branch I wasn't initially going to include here, but it will make merging easier later.
One less function call.
This wasn't needed.
@@ -3580,41 +3359,96 @@ meta_window_actor_invalidate_shadow (MetaWindowActor *self)
clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}

static inline guint8 OPACITY_TYPE_CARDINAL = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work. This ends up being 255 when you try to assign it to an unsigned int. Which ends up causing line 3376 to evaluate true any time you're at full opacity (255).

Open a nemo window, activate the debugger (ctrl-shift-d), pick the NemoWindow properties, and assign the opacity to something less than 1.0. The window updates. Now use the titlebar-scrolling to restore the opacity. It gets into a tug-of-war with the window opacity atom.

I think you have to either make set_opacity take a gint argument, then cast it to guint (eg mtwebster@3835e03) or make a separate method for the odd codepath that potentially reads the atom before calling set_opacity (mtwebster@a68c41d minus the property stuff). I prefer the latter, it's much simpler to understand (and maybe more efficient?)

Otherwise it seems to manage the opacity properly without issue, reacts to client opacity changes (and restores it after a restart).

@clefebvre clefebvre merged commit 7d4a9da into linuxmint:master Apr 5, 2019
clefebvre added a commit that referenced this pull request Jun 5, 2019
clefebvre added a commit that referenced this pull request Jun 5, 2019
clefebvre added a commit that referenced this pull request Jun 7, 2019
* Revert "Fix the current workspace not being selected during startup (#511)"

This reverts commit 5774eb2.

* Revert "Fix segfault when using cinnamon --replace (#512)"

This reverts commit edb3635.

* Revert "window-actor: Use source actor for the close, minimize effects (#508)"

This reverts commit fb2cb1a.

* Revert "Fix screensaver regressions (#489)"

This reverts commit c5253b4.

* Revert "window: Fix tile HUD color not changing when holding the snap modifier during a drag (#488)"

This reverts commit a4cff41.

* Revert "window: Call update_outer_rect in update_resize"

This reverts commit e75e879.

* Revert "window-actor: Update clip_shadow before the redraw"

This reverts commit 9157181.

* Revert "Unconditionalize meta_window_update_outer_rect (#484)"

This reverts commit 5bba546.

* Revert "window: Fix edge resistance"

This reverts commit ee0af72.

* Revert "hidpi: Restore scaling to initial cursor size, tile HUD threshold and"

This reverts commit c72054b.

* Revert "compositor: Check if priv is NULL before calling meta_window_actor_should_unredirect (#479)"

This reverts commit b625cfb.

* Revert " Fix cinnamon-screensaver freezing up when activated (#477)"

This reverts commit d6f5c40.

* Revert " window-actor: Support applying effects on clones (#464)"

This reverts commit 75776e7.

* Revert "window-actor: Add reference to MetaDisplay (#476)"

This reverts commit dae1fe7.

* Revert "boxes: Return if the rect pointers are null (#478)"

This reverts commit 4ef0065.

* Revert "Add MetaPrefsState struct for retrieving the prefs state without function invocation (#466)"

This reverts commit 72cf216.

* Revert "Make sure windows paint before un-fullscreening (#475)"

This reverts commit 355c404.

* Revert "Fix unredirected windows not being clipped out of the stage (#474)"

This reverts commit 1c45ee3.

* Revert "Replace some GLib wrappers (#421)"

This reverts commit 317c06f.

* Revert "compositor-private: remove a couple of duplicated lines (#472)"

This reverts commit 8e3c602.

* Revert "Replace some deprecated GDK methods (#443)"

This reverts commit 2a06ea9.

* Revert "compositor: Fix workspace switching, improve window dragging smoothness (#465)"

This reverts commit 7b97e77.

* Revert " Expose the sync method to preferences (#452)"

This reverts commit 40d073d.

* Revert "window: Remove obsolete cast in meta_window_adjust_opacity"

This reverts commit 3052914.

* Revert "window-actor: Use int for opacity"

This reverts commit 8448e69.

* Revert "window-actor: Make actor non-reactive (#440)"

This reverts commit 462a534.

* Revert "Add meta_display_popup_window_visible (#445)"

This reverts commit 4184eeb.

* Revert "Clean up the pre-paint functions (#460)"

This reverts commit 5011f94.

* Revert "Fix unredirection for wine games, mpv"

This reverts commit 63ddb02.

* Revert "Make compositor_private a MetaWindowActor type (#454)"

This reverts commit aeb6395.

* Revert "window-actor: override Clutter opacity property and method (#449)"

This reverts commit 7d4a9da.

* Revert "window-actor: Fix squished window textures (#453)"

This reverts commit f752fb5.

* Revert "Bump version"

This reverts commit 907f142.

* Revert "Revert two commits from #410 (#448)"

This reverts commit b1f346a.

* Revert "compositor: Fix tiling placement (#447)"

This reverts commit 023a6a4.

* Revert "window: Update monitor state before showing the window (#444)"

This reverts commit 45498a2.

* Revert "screen: Update the rect cache on monitor change (#441)"

This reverts commit edfc523.

* Revert "screen: Ensure monitors update on monitor change (#439)"

This reverts commit ad4dbc7.

* Revert "ui: Don't apply CSD window filtering for button events (#435)"

This reverts commit df879dc.

* Revert "Improve sync between the cursor and frames (#397)"

This reverts commit f9d161e.

* Revert "Various compositor improvements (#410)"

This reverts commit 48f669a.

* Revert "window: Cache the outer, client rects (#427)"

This reverts commit 009f0f3.
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.

None yet

3 participants