Bug 3120 - [GTK] Window resizing does not work reliably
Summary: [GTK] Window resizing does not work reliably
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Duncan Mak
URL:
: 1582 ()
Depends on:
Blocks:
 
Reported: 2012-01-27 15:57 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-04-10 15:55 UTC (History)
4 users (show)

Tags: gtk
Is this bug a regression?: ---
Last known good build:


Attachments
Patch 1 of 2: Export break_all_grabs within GDK Quartz backend (2.13 KB, patch)
2012-02-19 10:21 UTC, Kristian Rietveld (inactive)
Details
Patch 2 of 2: Fix manual window resizing (2.84 KB, patch)
2012-02-19 10:21 UTC, Kristian Rietveld (inactive)
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2012-01-27 15:57:25 UTC
With Mono 2.10.8.1 beta, which includes the new GTK+, window resizing is not reliable, especially when using the grip at the bottom right corner of the window.
Comment 1 Kristian Rietveld (inactive) 2012-02-15 15:05:19 UTC
I can confirm this.  The grip at the bottom right corner does not work for me most of the time.

If the bottom right grip is handling window resizing "itself" by using GTK+ calls, it is likely that this is conflicting with whatever OS X is trying to do.  I've seen such problems with the default GTK+ window resize grip.
Comment 2 Kristian Rietveld (inactive) 2012-02-17 15:31:36 UTC
If I am not mistaken, only the resize grip should be affected. There are two cases to distinguish:

  1. If you start the resize within ~5 pixels from the window border (in this case you see the double arrow cursor) , resizing works fine.

  2. If you start the resize further away from the window border, but still on the resize grip (in this case you see a different cursor (arrow pointing into a "corner")), then the resize does not behave properly.

This can be reproduced this way using the "application window demo" in gtk-demo as well.

Looking into a fix now.
Comment 3 Kristian Rietveld (inactive) 2012-02-17 16:27:12 UTC
When the resize is handled by GTK+ manually (instead of by Quartz), the expected events are received by the event translation function, but they end up in the wrong place. I think the events end up in GDK, but they are expected to be handled through Quartz (so they end up at sendEvent: in GdkQuartzWindow).

I need to double check how this was handled in Snow Leopard and whether GTK+'s own resizing worked at all there (otherwise, always the Quartz resizing was used).
Comment 4 Kristian Rietveld (inactive) 2012-02-19 10:19:23 UTC
> I need to double check how this was handled in Snow Leopard and whether GTK+'s
> own resizing worked at all there (otherwise, always the Quartz resizing was
> used).

For the record, GTK+'s manual resize does not work in Snow Leopard either.
Comment 5 Kristian Rietveld (inactive) 2012-02-19 10:20:44 UTC
I will attach two patches which fixes GTK+'s manual resizing.  Window resizing will then work regardless of where on the resize grip the drag is started.

Testing is appreciated. After testing, we will push this upstream in the 2-24 and latest 3-x branches.

This is related to upstream bug 512233 (https://bugzilla.gnome.org/show_bug.cgi?id=512233) where I've published the same patches.
Comment 6 Kristian Rietveld (inactive) 2012-02-19 10:21:14 UTC
Created attachment 1386 [details]
Patch 1 of 2: Export break_all_grabs within GDK Quartz backend
Comment 7 Kristian Rietveld (inactive) 2012-02-19 10:21:33 UTC
Created attachment 1387 [details]
Patch 2 of 2: Fix manual window resizing
Comment 8 Jeffrey Stedfast 2012-02-23 13:17:30 UTC
Kris: could you explain how to reproduce this on Snow Leopard?

(My dev machine is Snow Leopard)
Comment 9 Jeffrey Stedfast 2012-02-23 13:32:30 UTC
Assigning to Alan to test on Lion (since I'm on SL)

Alan: can you test these patches out sign off on them if they fix the issue on Lion for you?

We want to get these patches into Mono 2.10.9 final if we can.
Comment 10 Jeffrey Stedfast 2012-02-23 13:35:52 UTC
ok, apparently Alan is on holiday until Tuesday. I guess I'll have to try and remember to test this out on my MBA tonight when I get home.
Comment 11 Jeffrey Stedfast 2012-02-23 13:38:25 UTC
*** Bug 1582 has been marked as a duplicate of this bug. ***
Comment 12 Kristian Rietveld (inactive) 2012-02-24 02:20:48 UTC
> Kris: could you explain how to reproduce this on Snow Leopard?
> 
> (My dev machine is Snow Leopard)

Start the window resize by starting the drag on the resize grip as far *inside* the window as possible. I think you should be seeing a different mouse cursor compared to on the border of the window. This way you will test the GTK+ window resizing (instead of Quartz) which was broken without the patch.
Comment 13 Jeffrey Stedfast 2012-02-24 11:49:06 UTC
Aha! Yes! I can now reproduce! Thanks Kris!


Okay, verified that these 2 patches fix the resizing on Snow Leopard.


Duncan: can you add the patches from bockbuild commit 8dfadbae4e227cd232fe769116fe1d357f9c7252 to our Mono 2.10.9 build?
Comment 14 Duncan Mak 2012-03-28 17:30:08 UTC
We shipped these fixes in the 2.10.9_5 build of the Mac DMGs.
Comment 15 Kristian Rietveld (inactive) 2012-04-10 15:55:27 UTC
(Patches have beeb merged upstream)