xwindows / GTK Focus bug

2

As many have, this bug was first noticed quite a few years back (~2010). This bug is essentially when click one toolbar, then going to another area of the application, the window focus is not being correctly updated. This currently affect GIMP 2.8.22 (occasionally in multiwindow, frequently in single-window-mode) and Inkscape 0.92.2, making them practically unusable. These were once working really well, but now I tend to avoid them when I can.

I have searched many sources and they all lead to inconclusive bug reports or reports that a fix is not in the making.

I know of this issue, Is there a way to fix gimp on OSX to solve the xwindows focus issue? However, that is different since for that case, single-window-mode is a functioning workaround, but it does work.

More bug reports:

I am not sure if this MS Windows specific, but I can confirm this bug on some Win7 and Win10 PCs. However, in one of the reports, it seems some linux users were affected as well.

Can anyone shed some light on this? Is there a fix or workaround? Or is there theory as to why this is happening?

Update

I have resorted to using an old version of inkscape (v0.48.2). It works just fine on my home laptop (Win10) and work laptop (Win10). No window focus bug. Only 32 bit version is offered... could it be something with x64? I'll have to test that.

Update 2

This seems to be fixed in GIMP v2.9.8 (devel). https://www.gimp.org/downloads/devel/

Joe DF

Posted 2017-11-08T15:36:44.677

Reputation: 125

Could you post some more links to the bug reports you've found? I'm not clear on what exactly the issue is. – Nattgew – 2017-11-08T17:54:17.007

It must be a Windows problem. I use Gimp and Inkscape on a regular basis on Linux and both have no problems like you described. – theGtknerd – 2017-11-09T00:46:56.460

@Nattgew updated. – Joe DF – 2017-11-09T14:56:46.423

@theGtknerd I thought so too, but I've seen reports of this happening on linux too. I read somewhere that GTK know about it, but will not fix it. This bug only occurs on some windows computers (so it's not windows specific, it's something else...). – Joe DF – 2017-11-09T14:58:40.757

Sorry, I should have been more specific. I use Linux Mint. I do not see any bug reports that have Linux Mint as the OS. As a sidenote, Linux Ubuntu deliberately didn't care about Gtk for a few years. And Windows couldn't care less if Gtk disappeared. So you are somewhat at the mercy of the open source community (and yourself). – theGtknerd – 2017-11-09T16:09:23.700

@theGtknerd user "j.a.b.o.t" says linux mint 9: https://www.flickr.com/groups/48637250@N00/discuss/72157624568543780/72157624569839792 I have a mac, linux and windows system. I care about GTK, and this reflects badly on them... This is not an OS specific bug, either something with graphics or some config issues :(

– Joe DF – 2017-11-09T17:29:52.713

Can you tell me the steps to produce this behavior on your Linux box? What Linux distro (not that it matters) ? – theGtknerd – 2017-11-09T17:33:42.353

@theGtknerd I don't have my linux system with me right now and I have not tested it on that. Either way, I am rather certain this is not os specific. I can't reproduce this issue, it's just either there or not. I can say however, right after installing inkscape on the win10 pc, it worked fine until the next restart... – Joe DF – 2017-11-09T17:37:25.213

What does "then going to another area of the application" actually mean, in terms of user interactions? – Michael Schumacher – 2017-11-15T14:03:49.443

@MichaelSchumacher eg. drawing area – Joe DF – 2017-11-15T21:07:20.207

1

On the Windows platforms, there is an issue with GTK+ - a deliberate decision, actually - which interferes with event handling: https://bugzilla.gnome.org/show_bug.cgi?id=780979. If you got any application with transparent (i.e. invisible) fullscreen windows, this might be what you're seeing.

This is likely also the cause for some of the issues you have linked, but that list is quite diverse.

– Michael Schumacher – 2017-11-16T10:07:31.517

Answers

1

The list of issues linked to is diverse, and seems to be about some different causes.

There is, however, one issue within GTK+ which can cause symptoms like this, and is persistent as long as the triggering application are running. It has most recently been examined in a bug report for the GIMP applications, see https://bugzilla.gnome.org/show_bug.cgi?id=780979

It is an actual design choice for the GTK+ event handling, and was introduced to fix a bug:

  • if a mouse event happens, in particular a click, the UI toolkit (GTK+, its GDK subsystem) has to figure out what window this event should go to. Usually this is the uppermost window at the click location
  • it could be that this location is covered by another application's windows, however
  • and this exactly the case in the bug report: an application uses a full-screen transparent window to capture mouse gestures globally
  • GDK receives the mouse click, checks if any of the applications windows ar have been clicked, finds that they are covered by another applications windows, and discards the event

What can be done is to change the GTK+ source code to prevent this from happening. We got a GTK+ patch in the GIMP source tree and plan to test this with GIMP 2.9.8 on the MS Windows platforms. You can help by testing this version once it is published, because we're not sure if this causes other weird behavior (as the current event discarding was introduced to fix something).

Michael Schumacher

Posted 2017-11-08T15:36:44.677

Reputation: 811

1Very insightful. Thank you. I will try it when it is released. And accept once it is confirmed. – Joe DF – 2017-11-17T03:12:37.260

The GIMP 2.9.8 installer is available now, with the aforementioned GTK+ patch included: https://www.gimp.org/downloads/devel/

– Michael Schumacher – 2017-12-19T01:19:29.650

Seems to work fine here, I will try in on my other laptop later tonight. Could this be affected by having an older inkscape version installed? or is gimp's GTK completely self contained? – Joe DF – 2017-12-20T18:51:11.323

1It is completely self-contained (unless an application or user would sprinkle random DLL files into system directories). Sharing GTK+ in the common program files directory had been tried in the beginning, but without strict package management like on Linux platforms this approach was doomed to fail on the Windows platforms. – Michael Schumacher – 2017-12-20T21:56:06.907

1+1 Ok I see, thank you. There was a time I remember changing global GTK settings and gimp was indirectly affected. I have tested GIMP devel v2.9. I can't say anything for win7, but it works flawlessly on the two win10 machines. – Joe DF – 2017-12-21T15:06:55.157

0

I found that on my windows 7 , I changed the OS's theme from Areo to any Others, then there is no problem now !!

why Areo theme cannot work well with GTK+ ?

odora

Posted 2017-11-08T15:36:44.677

Reputation: 1

Interesting... I will have to test this on my Windows 10 Machines... thanks – Joe DF – 2017-11-23T06:19:00.997

That is one instance of transparent full-screen windows being used (by the Aero theme engine), for example. – Michael Schumacher – 2017-11-24T14:48:53.713