Bug 1963702 - GDK_CORE_DEVICE_EVENTS=1 being set breaks ability to use Firefox with xinput 2 support on X11
Summary: GDK_CORE_DEVICE_EVENTS=1 being set breaks ability to use Firefox with xinput ...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: kde-settings
Version: 39
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-23 14:58 UTC by Nate Graham
Modified: 2023-08-16 08:14 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nate Graham 2021-05-23 14:58:54 UTC
Description of problem:
GDK_CORE_DEVICE_EVENTS=1 is set in the environment by something, which breaks the ability to get support for touchscreens, pixel-by-pixel touchpad scrolling, and inertial touchscreen and touchpad scrolling in Firefox by setting MOZ_USE_XINPUT2=1.
 

How reproducible:
100% reproducible


Steps to Reproduce:
1. MOZ_USE_XINPUT2=1 firefox


Actual results:
Firefox is not activated in xinput2 mode


Expected results:
Firefox is activated in xinput2 mode


Additional info:
This does work:
unset GDK_CORE_DEVICE_EVENTS
MOZ_USE_XINPUT2=1 firefox


I do not know what is responsible for setting GDK_CORE_DEVICE_EVENTS, but it seems Fedora-specific, as I just switched from openSUSE Tumbleweed which did how have this environment variable set automatically by something.

If it is a GNOME-specific thing, perhaps it could be unset in the Fedora KDE spin, which I am using.

Comment 1 Neal Gompa 2021-05-23 18:44:11 UTC
This is actually set in kde-settings, transferring to that component.

Comment 2 Nate Graham 2021-05-24 04:18:29 UTC
If it was KDE-specific, maybe it was a workaround for https://bugs.kde.org/show_bug.cgi?id=394772? That was a really annoying bug, but it's been fixed since Plasma 5.19.3.

Comment 3 Ben Cotton 2022-05-12 16:25:50 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Nate Graham 2022-05-12 16:41:08 UTC
Still an issue in 36.

Comment 5 Toby 2022-07-07 21:31:55 UTC
Still an issue in Fedora36, also affects xournalpp (https://github.com/xournalpp/xournalpp/issues/2273)

Comment 6 thestroyer@cock.li 2023-01-30 13:28:52 UTC
I did a deep dive in the history of this bug and why GDK_CORE_DEVICE_EVENTS=1 is still being set for KDE.

In 2015 the following change was made in kde-settings:

* Tue Jun 16 2015 Rex Dieter <rdieter> - 22-11
	
- env: set GDK_CORE_DEVICE_EVENTS=1 to workaround gtk3 scrolling issues (#1226465)

It creates a file /etc/xdg/plasma-workspace/env/gtk3_scrolling.sh which sets the environment variable.

This was to work around a bug where gtk applications would not react to scoll events when not focused. This only seems to be the case in plasma. Shortly after, the workaround was disabled, but immediately re-enabled. It seems the workaround was still needed. In 2018 it was mentioned in [1] that disabling the workaround would result in the original bug resurfacing.

The bug was fixed in 2015 by gtk [3], but reverted with the maintainer mentioning that they have no hope fixing it for X11 and that we should wait for wayland to come around.

We should test if the focus bug still exists when disabling GDK_CORE_DEVICE_EVENTS in plasma X11. I don't see in the bug report that it's X11-specific, but I'm curious if this is an issue for wayland as well? It should be the magic bullet that fixes this mess :)


[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1226465#c48
[2]: https://bugs.kde.org/show_bug.cgi?id=348270
[3]: https://gitlab.gnome.org/GNOME/gtk/-/commit/77b8495
[4]: https://bugzilla.gnome.org/show_bug.cgi?id=750994#c8

Other related links: https://src.fedoraproject.org/rpms/kde-settings/c/352f046fbfb89dae74fcbbd6940bb166a867def1?branch=rawhide

Comment 7 Edward Samson 2023-01-31 00:54:07 UTC
What's an acceptable way to test this?

Anecdotally, I have disabled GDK_CORE_DEVICE_EVENTS to address the xournalpp issue. Using X11 on F37 KDE spin. I have not observed any scrolling issues, focused or not. Although maybe I'm not using any affected apps?

Examples of apps I use:

- Firefox
- gitk (git UI)
- Git Gui

Comment 8 Rex Dieter 2023-01-31 19:40:28 UTC
historyically firefox was the primary app I used to test/reproduce this.

Comment 9 thestroyer@cock.li 2023-01-31 21:09:54 UTC
This comment has reproduction steps. Not sure if they work. https://bugzilla.redhat.com/show_bug.cgi?id=1226465#c41

Comment 10 Edward Samson 2023-02-01 00:56:18 UTC
Comments over there seem to say it already worked then.

Testing now with my setup, disabled GDK_CORE_DEVICE_EVENTS, everything works for me as well.

Comment 11 thestroyer@cock.li 2023-02-01 10:12:40 UTC
I think those comments confirm the GDK_CORE_DEVICE_EVENTS=1 workaround fixes the scrolling issue. If a few people that follow this bug report can disable the workaround we can see if the scrolling issue comes back.

From this issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/558, it's confirmed once more that it's not fixed and cannot be properly fixed by GTK. I'm curious as to why this workaround is only applied for Fedora KDE. Or is it applied in other DE's and distro's as well?

Comment 12 Edward Samson 2023-02-01 10:53:08 UTC
I can confirm that with disabled GDK_CORE_DEVICE_EVENTS I experience the issue described in https://gitlab.gnome.org/GNOME/gtk/-/issues/558.

To be clear the issue is that the *first notch* of the scroll up or down does nothing. The second, and all following, scroll actions work as expected. Which, I'd say, is almost not an issue at all. I'd rather have that than have my pen or touchpad not working properly at all.

Comment 13 thestroyer@cock.li 2023-02-02 16:10:30 UTC
Yeah I can confirm the scoll issue as well. It's only really noticeable on mouses, but I think as the issue is currently it's too bad to remove the workaround by default. Individual users can decide to disable the workaround for themselves.

To disable the workaround you only have to remove the file /etc/xdg/plasma-workspace/env/gtk3_scrolling.sh and reboot for it to take effect. If you want to re-enable the workaround, place the file back. It simply contains:

#!/bin/sh

# see https://bugzilla.redhat.com/show_bug.cgi?id=1226465#c20
if [ -z "${GDK_CORE_DEVICE_EVENTS}" ]; then
GDK_CORE_DEVICE_EVENTS=1
export GDK_CORE_DEVICE_EVENTS
fi

I'm curious what Qt does. They don't seem to have any issues like this. Does anyone know what their solution is? It seems like the gtk folks don't want any heuristics to solve it, even though it seems to work fine for Qt.

Comment 14 thestroyer@cock.li 2023-02-02 16:25:56 UTC
This might be related to the Qt implementation: https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.12&id=a692d7cd

Comment 15 Ben Cotton 2023-04-25 16:42:34 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 16 Fedora Release Engineering 2023-08-16 08:14:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


Note You need to log in before you can comment on or make changes to this bug.