Bug 431890 - [GTK3] Can only press debug buttons twice before having to move the mouse
Summary: [GTK3] Can only press debug buttons twice before having to move the mouse
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 RC2   Edit
Assignee: Arun Thondapu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 413911 (view as bug list)
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2014-04-03 06:35 EDT by Marc Khouzam CLA
Modified: 2014-05-23 15:11 EDT (History)
7 users (show)

See Also:
arunkumar.thondapu: review+
lshanmug: review+


Attachments
Modified Snippet18 (1.67 KB, text/x-java)
2014-05-13 01:38 EDT, Marc-André Laperle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2014-04-03 06:35:04 EDT
With GTK3 I can only press the debugging buttons (step, resume) twice before they no longer respond to my mouse events.  I then have to move the mouse off the button and then put it back for another two clicks, etc.

I'm on Ubuntu 12.04 and it only happens when using GTK3 (3.4.2); when disabling GTK3 (using SWT_GTK3=0) I don't see the problem.

The strange thing is that this happens when debugging a Java project using JDT but not a C project using CDT.
Comment 1 Marc-André Laperle CLA 2014-04-03 12:38:47 EDT
I can reproduce the same behavior with GTK3 3.8.6-0ubuntu3.1 and Eclipse 4.4-I20140402-0100.
Comment 2 Alexander Kurtakov CLA 2014-04-03 12:57:32 EDT
Marc, a pure swt reproducer for the bug would give it higher priority for me.
Comment 3 Marc-André Laperle CLA 2014-05-13 01:38:38 EDT
Created attachment 242995 [details]
Modified Snippet18

Here is a snippet that reproduces the problem for me. In ToolItem.setEnabled, there is this code that looks suspicious:

...
* As a result, when it is re-enabled it automatically enters
* a PRELIGHT state. The fix is to set a NORMAL state.
* 
* Note that on GTK 3 this code causes the item to be re-enabled.
*/
if (OS.GTK_VERSION >= OS.VERSION (2, 14, 0) && !OS.GTK3) {
	OS.gtk_widget_set_state (topHandle, OS.GTK_STATE_NORMAL);
}

It sounds like this might be the same issue but GTK3 needs a different work around. Bug 271765 is the original SWT/GTK2 bug.
Comment 4 Marc-André Laperle CLA 2014-05-14 15:12:00 EDT
*** Bug 413911 has been marked as a duplicate of this bug. ***
Comment 5 Marc-André Laperle CLA 2014-05-21 17:45:33 EDT
I do not see either Bug 82169 or Bug 271765 when using GTK3 so the work arounds for GTK2 present in setEnabled do not need to be executed and it fixes the issue.

Patch:
https://git.eclipse.org/r/#/c/26970/

Tested with GTK 3.8.6 (Ubuntu 13.10) and 3.10.8 (Ubuntu 14.04).
Comment 6 Arun Thondapu CLA 2014-05-22 03:16:59 EDT
(In reply to Marc-Andre Laperle from comment #5)
> I do not see either Bug 82169 or Bug 271765 when using GTK3 so the work
> arounds for GTK2 present in setEnabled do not need to be executed and it
> fixes the issue.
> 
> Patch:
> https://git.eclipse.org/r/#/c/26970/
> 
> Tested with GTK 3.8.6 (Ubuntu 13.10) and 3.10.8 (Ubuntu 14.04).

Thanks for the patch Marc-Andre! I'm currently reviewing and testing it, will try to push it for RC2.
Comment 8 Marc Khouzam CLA 2014-05-22 10:16:50 EDT
Thanks Marc-Andre and all!
Comment 9 Marc-André Laperle CLA 2014-05-22 16:12:50 EDT
(In reply to Marc Khouzam from comment #8)
> Thanks Marc-Andre and all!

Marc, could you try the build on Ubuntu 12.04? You can either update your SDK with the update site [1] or download a brand new SDK [2].

[1] http://download.eclipse.org/eclipse/updates/4.4-I-builds 
[2] http://download.eclipse.org/eclipse/downloads/drops4/I20140522-1330/
Comment 10 Arun Thondapu CLA 2014-05-23 10:24:36 EDT
Verified in I20140522-1330 (on Ubuntu 12.04 & 14.04)
Comment 11 Marc-André Laperle CLA 2014-05-23 15:11:15 EDT
(In reply to Arun Thondapu from comment #10)
> Verified in I20140522-1330 (on Ubuntu 12.04 & 14.04)

Great, thank you Arun!