Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 508692

Summary: [Wayland] Shells has wrong size under wayland
Product: [Eclipse Project] Platform Reporter: Alexander Kurtakov <akurtakov>
Component: SWTAssignee: Alexander Kurtakov <akurtakov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: browseria, eclipsebugs, ipun, lufimtse, mike, patrick.tasse, thomas.mey
Version: 4.6Flags: akurtakov: neon+
Target Milestone: 4.6.3   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/86398
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=c522b03e3a4f934d453256d7bba55fbc4c375f6d
https://git.eclipse.org/r/87706
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=84e82fe721d9d1daa6bf08d2610c9b23c1d59427
https://git.eclipse.org/r/88633
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=717cf18517f39a2ab302d2b4291c8ca527e1e067
Whiteboard:
Bug Depends on:    
Bug Blocks: 496923, 510647    

Description Alexander Kurtakov CLA 2016-12-05 13:54:23 EST
Reason for that is that is the usage of GtkWindow allocation for the shell size which would fail with CSD (Client Side Decoration) as window decorations, shadows and etc. are part of the window allocation. It exposes on Wayland and Broadway backends as they have no server side decorations at all.
Comment 1 Eclipse Genie CLA 2016-12-05 14:00:37 EST
New Gerrit change created: https://git.eclipse.org/r/86398
Comment 2 Alexander Kurtakov CLA 2016-12-05 14:03:38 EST
Leo, Ian, Please test this guy thoroughly under X11 and wayland - I think it's straight forward but triple checking never hurts. Also please don't submit this week (if you think it's fine) so we don't risk milestone stability.
Comment 3 Leo Ufimtsev CLA 2016-12-05 14:32:20 EST
(In reply to Alexander Kurtakov from comment #2)
> Leo, Ian, Please test this guy thoroughly under X11 and wayland - I think
> it's straight forward but triple checking never hurts. Also please don't
> submit this week (if you think it's fine) so we don't risk milestone
> stability.

What is the test to verify that this patch fixes something?
Is it the menu-bar being miss-placed, or buttons cut off or shell itself spawning in the wrong place?
Comment 4 Alexander Kurtakov CLA 2016-12-05 15:11:54 EST
(In reply to Leo Ufimtsev from comment #3)
> (In reply to Alexander Kurtakov from comment #2)
> > Leo, Ian, Please test this guy thoroughly under X11 and wayland - I think
> > it's straight forward but triple checking never hurts. Also please don't
> > submit this week (if you think it's fine) so we don't risk milestone
> > stability.
> 
> What is the test to verify that this patch fixes something?
> Is it the menu-bar being miss-placed, or buttons cut off or shell itself
> spawning in the wrong place?

1 and 2 should be fixed.
Comment 5 Ian Pun CLA 2016-12-05 17:59:00 EST
Did some testing on Fedora 25 Wayland, couple things:

- Window Preferences doesn't seem to open for me 

- When opening up Project Preferences, the pop up window populates fine, but the IDE behind it seems to "dim", perhaps making the property window a modal one. The reason why I believe so is because if you try to drag the properties pop-up, it causes a strange bug the shrinks the IDE behind it while trying to drag. This happens to all the pop-up windows when I try to move them.

From your fix I do believe they are unrelated, as I believe these bugs exists already. It just means there are more bugs to fix before this is ready.
Comment 6 Alexander Kurtakov CLA 2016-12-06 02:24:23 EST
(In reply to Ian Pun from comment #5)
> Did some testing on Fedora 25 Wayland, couple things:
> 
> - Window Preferences doesn't seem to open for me 

This is under Gnome right? I ask because we may hit issues with other wayland compositors so knowing all the data helps. I can not reproduce that. Does it work without the patch?

> 
> - When opening up Project Preferences, the pop up window populates fine, but
> the IDE behind it seems to "dim", perhaps making the property window a modal
> one. The reason why I believe so is because if you try to drag the
> properties pop-up, it causes a strange bug the shrinks the IDE behind it
> while trying to drag. This happens to all the pop-up windows when I try to
> move them.

Preferences dialog has always been modal so I actually believe this is the correct behavior and the one on X11 was buggy (visually). Whether the preference dialog should be modal is another thing that you would better open a bug against platform.ui for dicussion.

> 
> From your fix I do believe they are unrelated, as I believe these bugs
> exists already. It just means there are more bugs to fix before this is
> ready.

So you see both issues with and without the patch?
Comment 7 Leo Ufimtsev CLA 2016-12-06 14:31:55 EST
(In reply to Alexander Kurtakov from comment #2)
> Leo, Ian, Please test this guy thoroughly under X11 and wayland - I think
> it's straight forward but triple checking never hurts. Also please don't
> submit this week (if you think it's fine) so we don't risk milestone
> stability.

This is a great bugfix!

Fixes: 
- Title bar mis-positioning, menu cut off
- Buttons cut off

Tested with child Eclipse, shell snippets, control example.  Doesn't break any jUnits. (some are failing for other reasons).
Tested on F25 w/ Wayland and XWayland.

I think good for merge when repos are open.
Comment 8 Leo Ufimtsev CLA 2016-12-06 14:50:59 EST
Works well on Gtk2 also.
I.e, F25 with Wayland. Eclipse in Gtk2 mode in XWayland.
Junit work fine also.
Comment 9 Leo Ufimtsev CLA 2016-12-06 14:58:42 EST
(In reply to Leo Ufimtsev from comment #8)
> Works well on Gtk2 also.
> I.e, F25 with Wayland. Eclipse in Gtk2 mode in XWayland.
> Junit work fine also.

This is for patch set 4.
Comment 10 Ian Pun CLA 2016-12-07 10:15:16 EST
(In reply to Alexander Kurtakov from comment #6)
> (In reply to Ian Pun from comment #5)
> > Did some testing on Fedora 25 Wayland, couple things:
> > 
> > - Window Preferences doesn't seem to open for me 
> 
> This is under Gnome right? I ask because we may hit issues with other
> wayland compositors so knowing all the data helps. I can not reproduce that.
> Does it work without the patch?
> 

I just retested it and it seems to work again. The issue doesn't seem to be happening in both pre-patch and patched, so this patch is a +1 for me. Yes it is under Gnome. 

> > 
> > - When opening up Project Preferences, the pop up window populates fine, but
> > the IDE behind it seems to "dim", perhaps making the property window a modal
> > one. The reason why I believe so is because if you try to drag the
> > properties pop-up, it causes a strange bug the shrinks the IDE behind it
> > while trying to drag. This happens to all the pop-up windows when I try to
> > move them.
> 
> Preferences dialog has always been modal so I actually believe this is the
> correct behavior and the one on X11 was buggy (visually). Whether the
> preference dialog should be modal is another thing that you would better
> open a bug against platform.ui for dicussion.
> 

Ah I see what you mean, at least (going forward) our modal dialog will be displaying correctly.
Comment 12 Alexander Kurtakov CLA 2016-12-12 08:45:33 EST
*** Bug 497607 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Kurtakov CLA 2016-12-12 08:46:12 EST
*** Bug 496924 has been marked as a duplicate of this bug. ***
Comment 14 Alexander Kurtakov CLA 2016-12-12 08:46:51 EST
*** Bug 496926 has been marked as a duplicate of this bug. ***
Comment 15 Alexander Kurtakov CLA 2016-12-20 00:22:40 EST
*** Bug 509387 has been marked as a duplicate of this bug. ***
Comment 16 Ian Pun CLA 2016-12-23 10:56:31 EST
Causes Bug 509596, initial patch of conditional GTK2 vs GTK3 would fix this issue.
Comment 17 Ian Pun CLA 2016-12-23 10:57:19 EST
*** Bug 509596 has been marked as a duplicate of this bug. ***
Comment 18 Eclipse Genie CLA 2016-12-23 11:12:01 EST
New Gerrit change created: https://git.eclipse.org/r/87706
Comment 20 Leo Ufimtsev CLA 2016-12-23 12:55:05 EST
Closing as shell sizing works for gtk3/wayland and still works on gtk2 now.
Comment 21 Alexander Kurtakov CLA 2017-01-09 05:37:26 EST
Actually resolve.
Comment 22 Alexander Kurtakov CLA 2017-01-09 12:13:54 EST
Reopen for backport.
Comment 23 Eclipse Genie CLA 2017-01-13 07:31:04 EST
New Gerrit change created: https://git.eclipse.org/r/88633
Comment 25 Alexander Kurtakov CLA 2017-01-13 07:35:29 EST
Backported.