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 643020 - libgtk2 2.24.0 break Lotus Notes user interface
libgtk2 2.24.0 break Lotus Notes user interface
Status: RESOLVED NOTGNOME
Product: gtk+
Classification: Platform
Component: Backend: X11
2.24.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-02-22 23:56 UTC by Søren Holm
Modified: 2011-09-20 10:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of gui with 'missing' parts.. (121.54 KB, image/png)
2011-02-25 23:44 UTC, Søren Holm
Details
Screenshot of correct gui with no missing parts. (139.49 KB, image/png)
2011-02-25 23:45 UTC, Søren Holm
Details
a testcase (630 bytes, text/plain)
2011-08-30 15:40 UTC, Matthias Clasen
Details

Description Søren Holm 2011-02-22 23:56:18 UTC
I'm running Lotus Notes at work, but on natty most parts of the application is rendered useless. The reason is a change in libgtk2 that destroys Lotus Notes' ability to draw its own gui.
Since Lotus Notes is a closed source application I am very limited in my search for the cause, but I have bisected libgtk2 and found the following commit to be the bad guy :
c282958fb4bb25c736c682735002d15c50cb44d0 is the first bad commit
 commit c282958fb4bb25c736c682735002d15c50cb44d0
 Author: Matthias Clasen <mclasen@redhat.com>
 Date: Tue Dec 14 22:24:09 2010 -0500
    Optimize gdk_window_set_shape_combine_region
    When setting no shape on an unshaped window, nothing changes,
     so return early instead of recomputing lots of visibility
     information.
    Pointed out by Owen Taylor in bug 637156.
:040000 040000 ef945a068fc514b34877c2beeab6185d433e8892 a96cac159dce4190a93c1a853e90635f7405bdf6 M gdk


The complete bisect log looks like this :
git bisect start
 # bad: [0b3710d762decd49547d17d8decb316c4eca0968] Fix doc format problems
 git bisect bad 0b3710d762decd49547d17d8decb316c4eca0968
 # good: [0200763126d07c6f852cf09854f2d98f0befc73f] Fix header inclusions for !srcdir builds
 git bisect good 0200763126d07c6f852cf09854f2d98f0befc73f
 # bad: [3bdd56c92802fa24b4769492611c327aa128e281] Add some forgotten accessors for GdkDragContext
 git bisect bad 3bdd56c92802fa24b4769492611c327aa128e281
 # good: [df08bc43ec91cfacc5c8b91e8cd57d9f5a87c162] gdk: Add XSetting for "gtk-cursor-blink-timeout"
 git bisect good df08bc43ec91cfacc5c8b91e8cd57d9f5a87c162
 # good: [b91b0ebbd7fb873228708b9fc4d56ecbf4f8fb28] tests: Remove unused variable
 git bisect good b91b0ebbd7fb873228708b9fc4d56ecbf4f8fb28
 # good: [6e2573fd76fbcafcca3d70e1739bc8fead709d50] gtk_combo_box_get_active_text(): Fix my docs typo.
 git bisect good 6e2573fd76fbcafcca3d70e1739bc8fead709d50
 # good: [64f2460b7baad65cff8441df72e7acfa461c6043] Deprecate gtk_widget_reset_shapes
 git bisect good 64f2460b7baad65cff8441df72e7acfa461c6043
 # bad: [53ff5679f7331bc61fdea387e36513b63129894c] Fixed gtk_entry_set_icon_tooltip_text & markup to not crash
 git bisect bad 53ff5679f7331bc61fdea387e36513b63129894c
 # bad: [c282958fb4bb25c736c682735002d15c50cb44d0] Optimize gdk_window_set_shape_combine_region
 git bisect bad c282958fb4bb25c736c682735002d15c50cb44d0

I can add, that reverting the change on top of 2.24.0 fixes the issue. So I guess that it will be the case for the current version in natty too.

Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/723458
Comment 1 Matthias Clasen 2011-02-25 17:12:49 UTC
Can you provide some information as to how it 'breaks the user interface' ?
Comment 2 Søren Holm 2011-02-25 23:44:51 UTC
Created attachment 181955 [details]
Screenshot of gui with 'missing' parts..

The header in the message preview pane is not rendered correctly. Also the faverites section in the bottom left is missing.
Comment 3 Søren Holm 2011-02-25 23:45:45 UTC
Created attachment 181956 [details]
Screenshot of correct gui with no missing parts.
Comment 4 André Klapper 2011-02-25 23:57:58 UTC
Is Lotus Notes open-source?
I don't think this is easy to analyze without being able to look at the code...
Is there any output on the terminal?
Comment 5 Søren Holm 2011-02-26 00:10:50 UTC
Lotus Notes is definetely not open source.

The terminal output does not contain anything differences between a work and 
non-working run.
Comment 6 Søren Holm 2011-02-27 09:06:12 UTC
Clearly both private->shaped and shape_region is null. If have attenpted to write out the state of the two like this :


diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index aa0a90d..096c9dd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8642,6 +8642,11 @@ gdk_window_shape_combine_region (GdkWindow       *window,
   if (GDK_WINDOW_DESTROYED (window))
     return;
 
+  if (!private->shaped)
+    printf("private->shaped is null\n");
+  if (!shape_region)
+    printf("shape_region is null\n");
+
   private->shaped = (shape_region != NULL);
 
   if (private->shape)


What is interresting is that I get a lot of output while the gui is initialized, but doing things like selecting a new email to be previewed (which will redraw the preview area) does not give any output regard the two variavbles being null.

So it might be ralated to the resizing of the gui when notes is starting up. Resizing the window also gives me output from my printf-lines.
Comment 7 Søren Holm 2011-03-02 13:43:28 UTC
What is the status of this currently?

Is it a problem rolling back c282958fb4bb25c736c682735002d15c50cb44d0 or should I rather add additional debug-code to gtk to try to crasp what is actually going on with lotus to find another way to solve it.

I could of cause patch ubuntus packaging of gtk, but it would be a nicer solution to find some upstream way to handle it.
Comment 8 André Klapper 2011-03-02 14:21:57 UTC
Lotus should probably adapt their code to the latest GTK - did you contact them?
Comment 9 Søren Holm 2011-03-02 14:39:56 UTC
I tried but calling IBM does not help. Do you have some contact information I could use?
Comment 10 André Klapper 2011-03-02 14:44:13 UTC
No...
Comment 11 Søren Holm 2011-03-11 22:55:29 UTC
FYI I have published a hack here : https://github.com/sgh/lotus-notes_gtk2.23.3
Comment 12 Wen Long FENG 2011-06-16 06:18:16 UTC
Per my understanding, it is a bug involved by gtk code change.
Per the documentation of gdk_window_shape_combine_region, setting shape_region to NULL should make the gdkwindow be opaque. But under the new code, the function will do nothing when set shape_region as NULL.
Comment 13 Søren Holm 2011-06-16 06:38:24 UTC
That is interresting news. I where just naive and trusted the commit message. Thanks for that additional research. Maybe now the commit could be reverted?
Comment 14 Søren Holm 2011-07-10 20:14:15 UTC
Is Wen Long Feng right about his thoughts? I can also see in the coe this :


 * If @shape_region is %NULL, the shape will be unset, so the whole
 * window will be opaque again. @offset_x and @offset_y are ignored
 * if @shape_region is %NULL.

So I guess he is right. Could someone please revert 208d717fefb7d1d1faa0dada132a290036b458d0 ?
Comment 15 Søren Holm 2011-07-20 21:44:28 UTC
Any news on this?
Comment 16 Owen Taylor 2011-07-20 22:46:47 UTC
(In reply to comment #12)
> Per my understanding, it is a bug involved by gtk code change.
> Per the documentation of gdk_window_shape_combine_region, setting shape_region
> to NULL should make the gdkwindow be opaque. But under the new code, the
> function will do nothing when set shape_region as NULL.

This comment needs to be explained with a short, self contained test case that demonstrates the problem. The code looks correct to me as far as I can tell. If private->shaped is NULL, then the window *is* opaque, and nothing further needs to be done.

My only guess is that the SWT code in Lotus Notes is manipulating the shape of the window using direct X calls then assuming that gdk_window_shape_combine_region() will undo that. If that's the case, I don't think we should revert the change.

But maybe there is some case I'm missing when looking at the code, and it actually is a GDK bug.
Comment 17 Søren Holm 2011-07-20 23:20:10 UTC
Well I do not have a concrete test case other that Lotus Notes.

I have in this moment attempted to draw the lotus teams' attention to this bug. They must know what happenens. I hope that they will reply.
Comment 18 Wen Long FENG 2011-07-21 02:35:19 UTC
(In reply to comment #16)
> (In reply to comment #12)
> > Per my understanding, it is a bug involved by gtk code change.
> > Per the documentation of gdk_window_shape_combine_region, setting shape_region
> > to NULL should make the gdkwindow be opaque. But under the new code, the
> > function will do nothing when set shape_region as NULL.
> 
> This comment needs to be explained with a short, self contained test case that
> demonstrates the problem. The code looks correct to me as far as I can tell. If
> private->shaped is NULL, then the window *is* opaque, and nothing further needs
> to be done.
> 
> My only guess is that the SWT code in Lotus Notes is manipulating the shape of
> the window using direct X calls then assuming that
> gdk_window_shape_combine_region() will undo that. If that's the case, I don't
> think we should revert the change.
> 
> But maybe there is some case I'm missing when looking at the code, and it
> actually is a GDK bug.

The new code has not implement what the API docment defines -- When set shaped_region to null , it should make the whole window transparent.

With current code, how could a user make a window transparent? When I create a gtk window, its initial flag of shaped is false. And the flag has only be set when call gdk_window_shape_combine_region. With the original code, I only need to set shape_region to NULL, but with current code change, I need to firstly call your api with an non-empty shape_region to set the flag to true and then call your api again with an NULL shape_region to make the whole window transparent.
Comment 19 Søren Holm 2011-07-30 00:08:38 UTC
What is the status? Doe anyone disagree with Wen.
Comment 20 Søren Holm 2011-08-08 08:33:54 UTC
What is the status of this bug?
Comment 21 Matthias Clasen 2011-08-30 15:40:21 UTC
Created attachment 195225 [details]
a testcase

Here is a quick testcase that seems to show gdk_window_shape_combine_region work as intended:

null region -> unshaped
nonempty region -> everything outside the region is shaped away 
empty region -> everything is shaped away

Can you modify the testcase to demonstrate a change in behavior of gdk_window_shape_combine_region ?
Comment 22 Wen Long FENG 2011-09-20 09:35:58 UTC
Hi Matthias,
Thanks for your attention, I agree it makes things no different from gdk view although the losing of the side effect has break lotus notes, pls close this request, I will take the issue back to our own layer.
Comment 23 Emmanuele Bassi (:ebassi) 2011-09-20 10:47:08 UTC
closing, as per comment 22.