After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659302 - windowManager: Temporarily disable window dimming
windowManager: Temporarily disable window dimming
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 660026 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-17 07:07 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-09-24 21:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
windowManager: Temporarily disable window dimming (1.09 KB, patch)
2011-09-17 07:07 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
windowManager: Use an off-screen buffer for window dimming (4.19 KB, patch)
2011-09-17 18:45 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
windowManager: Use an off-screen buffer for window dimming (4.24 KB, patch)
2011-09-17 19:57 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
windowManager: Incorporate invisible borders into window dimming effect (4.50 KB, patch)
2011-09-17 19:57 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
windowManager: Use an off-screen buffer for window dimming (5.68 KB, patch)
2011-09-18 23:47 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
windowManager: Incorporate invisible borders into window dimming effect (4.29 KB, patch)
2011-09-18 23:48 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
windowManager: Use an off-screen buffer for window dimming (6.20 KB, patch)
2011-09-19 14:57 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
windowManager: Incorporate invisible borders into window dimming effect (4.57 KB, patch)
2011-09-19 14:57 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-09-17 07:07:38 UTC
The way the window dimmer shader is written doesn't like the rounded corners or
invisible borders, since it doesn't deal well with the multitexturing used by
the MetaShapedTexture. Since it is a rather subtle effect, and it causes
major graphical glitches, temporarily disable it for 3.2 until it can be
fixed.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-09-17 07:07:40 UTC
Created attachment 196790 [details] [review]
windowManager: Temporarily disable window dimming
Comment 2 drago01 2011-09-17 09:09:22 UTC
Review of attachment 196790 [details] [review]:

We probably should just port it to ClutterShaderEffect (which deals with the multitexturing by redirecting it to an FBO).
FBOs are relatively expensive but normally we don't end up dealing with 10 or more attached dialogs at a time.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-09-17 18:45:06 UTC
Created attachment 196818 [details] [review]
windowManager: Use an off-screen buffer for window dimming

The way the window dimmer shader is written doesn't like the rounded corners or
invisible borders, since it doesn't deal well with the multitexturing used by
the MetaShapedTexture. Use an off-screen buffer to flatten the texture before
being applied.



--

Alternate solution, using an off-screen buffer. Doesn't work, appears to be a cogl bug:

<magcius> drago01, (lt-gnome-shell-real:16452): Cogl-WARNING **: ./cogl-buffer.c:359: GL error (1282): Invalid operation
<magcius> brillant
<drago01> huh?
<magcius> drago01, see any problems in http://fpaste.org/Id3D/ ?
<drago01> magcius: non that would obviusly cause a gl error ... 
<magcius> I would love to know what invalid operation I'm doing.
<drago01> hmm ... try commenting out the set_uniform_value calls
* drago01 checks what cogl does in cogl-buffer.c:359
<magcius>       GE( ctx, glBindBuffer (gl_target, buffer->gl_handle) );
<drago01> magcius: "GL_INVALID_OPERATION is generated if glBindBuffer is executed between the execution of glBegin and the corresponding execution of glEnd."
<drago01> magcius: http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
<drago01> magcius: can't see how this would be your fault
<drago01> magcius: looks like a cogl bug
Comment 4 drago01 2011-09-17 19:14:19 UTC
Review of attachment 196790 [details] [review]:

We can do better than that.
Comment 5 drago01 2011-09-17 19:15:13 UTC
(In reply to comment #3)
> Created an attachment (id=196818) [details] [review]
> windowManager: Use an off-screen buffer for window dimming
> 
> The way the window dimmer shader is written doesn't like the rounded corners or
> invisible borders, since it doesn't deal well with the multitexturing used by
> the MetaShapedTexture. Use an off-screen buffer to flatten the texture before
> being applied.
> 
> 
> 
> --
> 
> Alternate solution, using an off-screen buffer. Doesn't work, appears to be a
> cogl bug:
> 
> <magcius> drago01, (lt-gnome-shell-real:16452): Cogl-WARNING **:
> ./cogl-buffer.c:359: GL error (1282): Invalid operation
> <magcius> brillant
> <drago01> huh?
> <magcius> drago01, see any problems in http://fpaste.org/Id3D/ ?
> <drago01> magcius: non that would obviusly cause a gl error ... 
> <magcius> I would love to know what invalid operation I'm doing.
> <drago01> hmm ... try commenting out the set_uniform_value calls
> * drago01 checks what cogl does in cogl-buffer.c:359
> <magcius>       GE( ctx, glBindBuffer (gl_target, buffer->gl_handle) );
> <drago01> magcius: "GL_INVALID_OPERATION is generated if glBindBuffer is
> executed between the execution of glBegin and the corresponding execution of
> glEnd."
> <drago01> magcius: http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
> <drago01> magcius: can't see how this would be your fault
> <drago01> magcius: looks like a cogl bug

That turned out to height being sent as int rather then float to the shader.
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-09-17 19:57:26 UTC
Created attachment 196825 [details] [review]
windowManager: Use an off-screen buffer for window dimming

The way the window dimmer shader is written doesn't like the rounded corners or
invisible borders, since it doesn't deal well with the multitexturing used by
the MetaShapedTexture. Use an off-screen buffer to flatten the texture before
being applied.



A bit hacky, but it works.
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-09-17 19:57:31 UTC
Created attachment 196826 [details] [review]
windowManager: Incorporate invisible borders into window dimming effect

Without this, the dim "fade" will start at the top of the untrimmed actor. With
a large enough draggable_border_width setting, this will show no fade at all.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-09-18 23:47:55 UTC
Created attachment 196892 [details] [review]
windowManager: Use an off-screen buffer for window dimming

The way the window dimmer shader is written doesn't like the rounded corners or
invisible borders, since it doesn't deal well with the multitexturing used by
the MetaShapedTexture. Use an off-screen buffer to flatten the texture before
being applied.



Here's something a little less hacky.
Comment 9 Jasper St. Pierre (not reading bugmail) 2011-09-18 23:48:01 UTC
Created attachment 196893 [details] [review]
windowManager: Incorporate invisible borders into window dimming effect

Without this, the dim "fade" will start at the top of the untrimmed actor. With
a large enough draggable_border_width setting, this will show no fade at all.
Comment 10 drago01 2011-09-19 06:57:00 UTC
Review of attachment 196892 [details] [review]:

Looks good to me. Should be fine to commit with the comment added (assuming no objections from Owen).

::: src/shell-util.c
@@ +853,3 @@
+
+void
+shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect,

Add a comment explaining why we need this.
Comment 11 drago01 2011-09-19 07:01:23 UTC
Review of attachment 196893 [details] [review]:

Looks good, comment needs to be update to reflect your changes. (Fine to commit with that fixed).

::: data/shaders/dim-window.glsl
@@ +23,3 @@
   // when the fraction is 1.0. For other locations and fractions we linearly
   // interpolate back to the original undimmed color.
+  cogl_color_out = color + (cogl_color_out - color) * max(min((y - startY) / border_max_height, 1.0), 0.0);

Adjust to comment to explain this as well.
Comment 12 Colin Walters 2011-09-19 13:02:35 UTC
(In reply to comment #3)
> Created an attachment (id=196818) [details] [review]
> windowManager: Use an off-screen buffer for window dimming
> 
> The way the window dimmer shader is written doesn't like the rounded corners or

"doesn't like" is a bad description.  What actually happens? "triggers an assertion"?  "Corrupts the state?"  etc.

Add to the commit message something more descriptive, please.  And preferably a link to a cogl bug or whoever is at fault.
Comment 13 drago01 2011-09-19 13:06:51 UTC
(In reply to comment #12)
> (In reply to comment #3)
>
> Add to the commit message something more descriptive, please.  And preferably a
> link to a cogl bug or whoever is at fault.

There is no cogl bug. The problem is that ClutterShader only operates on a single texture, which is no longer sufficient due to the invisible borders. So it redirects everything to an FBO and applies the shader on that (using ClutterShaderEffect). So when we just pass the texture to it we get wrong rendering.

As for the commit message yeah should probably be improved.
Comment 14 drago01 2011-09-19 13:07:38 UTC
Review of attachment 196892 [details] [review]:

Marking as needs-work due to Colin's comment re commit message.
Comment 15 Jasper St. Pierre (not reading bugmail) 2011-09-19 14:57:33 UTC
Created attachment 196950 [details] [review]
windowManager: Use an off-screen buffer for window dimming

The way the window dimmer shader is written will cause rendering errors with
the rounded corners, invisible borders or shaped textures since it doesn't deal
well with the multitexturing used by the MetaShapedTexture. Use an off-screen
buffer to flatten the texture before being applied.
Comment 16 Jasper St. Pierre (not reading bugmail) 2011-09-19 14:57:43 UTC
Created attachment 196951 [details] [review]
windowManager: Incorporate invisible borders into window dimming effect

Without this, the dim "fade" will start at the top of the untrimmed actor. With
a large enough draggable_border_width setting, this will show no fade at all.



Is this better?
Comment 17 Jasper St. Pierre (not reading bugmail) 2011-09-19 16:40:41 UTC
Attachment 196950 [details] pushed as 82eccb5 - windowManager: Use an off-screen buffer for window dimming
Attachment 196951 [details] pushed as 127ef83 - windowManager: Incorporate invisible borders into window dimming effect
Comment 18 Jasper St. Pierre (not reading bugmail) 2011-09-24 21:35:16 UTC
*** Bug 660026 has been marked as a duplicate of this bug. ***