Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch Support / Opens Chrome app window twice #128

Closed
plopp37 opened this issue Dec 23, 2014 · 35 comments
Closed

Touch Support / Opens Chrome app window twice #128

plopp37 opened this issue Dec 23, 2014 · 35 comments

Comments

@plopp37
Copy link

plopp37 commented Dec 23, 2014

When opening pinned any Chrome app, it creates two windows instead of just one. Experiencing on gnome-shell 3.14.1 in Ubuntu Gnome 14.10

@micheleg
Copy link
Owner

Hi,

Can you confirm this happens because of the extension? Does it work as
expected with the default dash?

@plopp37
Copy link
Author

plopp37 commented Dec 23, 2014

Hi,
at the moment of writing the bug report I was able to reproduce it on
fully updated system; it only happened while opening pinned app from
the dock, not from default gnome dash. But now it works the same from
dock and dash (with extension off) while having some issue with Chrome
as a whole :))
I suppose there was some problem with cached data, because I have used
Bleachbit to clean it few hours ago.
I will let you know if the problem shows again.
Thanks for now,
J.

Michele notifications@github.com napsal Út, pro 23, 2014 v 5∶45 :

Hi,

Can you confirm this happens because of the extension? Does it work as
expected with the default dash?

Reply to this email directly or view it on GitHub.

@plopp37
Copy link
Author

plopp37 commented Dec 23, 2014

Hi,
now I can confirm this happens because of the extension. However it is
triggered only when I launch the app with touch on my touchscreen.
While using mouse/trackpad, only single instance is launched. I have
found two more issues with touch right now -- the Applications button
does not react to tap, I have to hold it down and slide finger out of
the button to trigger App overview. Sliding finger from left edge of
the screen to trigger Dash overview does not work either. Other Gnome
gestures work as they should.
So it seems that all these issues are somehow related to how the
extension handles input.
Thanks,
J.

Michele notifications@github.com napsal Út, pro 23, 2014 v 5∶45 :

Hi,

Can you confirm this happens because of the extension? Does it work as
expected with the default dash?

Reply to this email directly or view it on GitHub.

@micheleg
Copy link
Owner

Hi,

thanks for this information. I have been wondering for a while about touch gestures. Unfortunately, I don't have any device to test the code.

Regarding the problem with the dash, I overwrite and extend the code handling mouse events on the appIcon and the Application button. I think the touch event is triggering twice the click . I'll investigate to understand how touch events are handled by the shell. Could you check if disabling in the settings the customization of the click actions makes the problem with the double instance launching disappear?

Regarding the swipe to trigger the dash show, I have been thinking to implement such think but have been blocked but not being able to test any code as well, so I'm not surprised it doesn't work. Which widget in the shell handle swipe events?

I'll try to solve the click problem as soon as I have time, but I'll need your help to double check if my code will work as expected.

@micheleg micheleg added the bug label Dec 23, 2014
@micheleg micheleg changed the title Opens Chrome app window twice Touch Support / Opens Chrome app window twice Dec 23, 2014
@plopp37
Copy link
Author

plopp37 commented Dec 23, 2014

None of the optional behavior settings seem to have effect on this
issue.
However I have found some interesting things:
The issue is that the dock starts only the Chrome apps twice, but the
double click is triggered by tap for all apps, which I have found when
I have set click behavior to Minimize -- tapping any running app icon
makes it minimize and restore again.
The same probably goes for the AppOverview icon, which is why it does
nothing on tap.
The touch gestures are hardcoded in gnome-shell 3.14, which is why I
was complaining to the left-edge-swipe not working.
I hope this will help somehow.
J.

Michele notifications@github.com napsal Út, pro 23, 2014 v 8∶38 :

Hi,

thanks for this information. I have been wondering for a while about
touch gestures. Unfortunately, I don't have any device to test the
code.

Regarding the problem with the dash, I overwrite and extend the code
handling mouse events on the appIcon and the Application button. I
think the touch event is triggering twice the click . I'll
investigate to understand how touch events are handled by the shell.
Could you check if disabling in the settings the customization of the
click actions makes the problem with the double instance launching
disappear?

Regarding the swipe to trigger the dash show, I have been thinking to
implement such think but have been blocked but not being able to test
any code as well, so I'm not surprised it doesn't work. Which widget
in the shell handle swipe events?

I'll try to solve the click problem as soon as I have time, but I'll
need your help to double check if my code will work as expected.


Reply to this email directly or view it on GitHub.

@plopp37
Copy link
Author

plopp37 commented Dec 23, 2014

And there is one more thing that might be related to this:
When I start a Chrome app with a mouse/trackpad click on the dock or
dash (it seems to be your-extension-independent bug), I am not able to
control that app with touch gestures (swipe to scroll, tap to
click...); i need to start the chrome app with a tap to be able to
touch-control :))
J.

Jiří Husák plopp37@gmail.com napsal Út, pro 23, 2014 v 10∶19 :

None of the optional behavior settings seem to have effect on this
issue.
However I have found some interesting things:
The issue is that the dock starts only the Chrome apps twice, but the
double click is triggered by tap for all apps, which I have found
when I have set click behavior to Minimize -- tapping any running app
icon makes it minimize and restore again.
The same probably goes for the AppOverview icon, which is why it does
nothing on tap.
The touch gestures are hardcoded in gnome-shell 3.14, which is why I
was complaining to the left-edge-swipe not working.
I hope this will help somehow.
J.

Michele notifications@github.com napsal Út, pro 23, 2014 v 8∶38 :

Hi,

thanks for this information. I have been wondering for a while about
touch gestures. Unfortunately, I don't have any device to test the
code.

Regarding the problem with the dash, I overwrite and extend the code
handling mouse events on the appIcon and the Application button. I
think the touch event is triggering twice the click . I'll
investigate to understand how touch events are handled by the shell.
Could you check if disabling in the settings the customization of
the click actions makes the problem with the double instance
launching disappear?

Regarding the swipe to trigger the dash show, I have been thinking
to implement such think but have been blocked but not being able to
test any code as well, so I'm not surprised it doesn't work. Which
widget in the shell handle swipe events?

I'll try to solve the click problem as soon as I have time, but I'll
need your help to double check if my code will work as expected.


Reply to this email directly or view it on GitHub.

@micheleg
Copy link
Owner

micheleg commented May 4, 2015

A similar problem was reported by Corey in Debian 8

I noticed a bug in it.

Clicking my Chrome icon always opens a new window instead of the
bringing an exiting window to focus.
Other apps behave normally, it's just Chrome. Not sure it that's
something that can be fixed or not.

@schuhumi
Copy link

I can confirm the bug. Touching AppOverview seem to trigger it twice. Once when the finger touches the glass and once when it leaves again (overview can also be opened by holding down the finger).
edit: It works just fine in the activities overview /edit

Also scrolling doesn't work (both workspace scrolling and app list scrolling when fixed icon size is activated)

@micheleg
Copy link
Owner

Thanks for the additional information. However I'm really unable to test any touch related feature.

@tuomasjjrasanen
Copy link

I think this issue has nothing to do with dash-to-dock per se. It seems to happen only when an app is launched by touching a touchscreen. Occasionally, a touch event is recognized as two consecutive clicked-events. And it happens also with panel actors.

I reproduced the issue by just adding a simple button to the panel and logged all clicked-events. Sometimes, a single touch produced two clicked-events, sometimes just one. If I connected button-press-event, I got only one per touch.

But I'm not sure at which level the event mismatch happens. I checked the input stream from the corresponding event device (/dev/input/eventX) and it seemed just fine, so it's not a touchscreen-specific issue.

Anyone has any ideas?

@elman22
Copy link

elman22 commented Dec 13, 2016

I can confirm this issue as well. I have made these tests:

  • Manjaro Linux, Gnome 3.22, kernel 4.4 and 4.8, 2 laptops - issue is present in all configurations,
  • Apricity OS, Gnome 3.22, kernel 4.4, 2 laptops - issue is present in all configurations,
  • Korora 25, Gnome 3.22, kernel 4.8, 1 laptop - issue is NOT present, everything works as expected.

First I thought it might be Arch issue, but #196 says bug is also present on Ubuntu. Then I thought it might be kernel 4.4 issue, but after upgrading Manjaro kernel to 4.8, issue is still present.

What is doing Fedora/Korora differently?

@micheleg
Copy link
Owner

@elman22, @tuomasjjrasanen Can you confirm if the issue occurs also with the default dash or in the appgrid overview?

I have no easy way to debug touch events. I've always assumed that I was missing something in my code to avoid the duplicate event, but from you comments it seems the problem is at an higher level

@elman22
Copy link

elman22 commented Dec 19, 2016

Just checked Manjaro and this issue does not occur with default dash in app grid overview. Apps show up as expected.

Also I just realized that Manjaro and Apricity run X11 sessions and Korora runs Wayland session. So maybe that is reason why Korora works fine.

@ghost
Copy link

ghost commented Feb 23, 2017

Hello, I'm using arch linux. The bug it's only present when using X11. Wayland it's unaffected
The same happens with dash to panel extension.
But without extensions for the dash, it doesn't happen

@micheleg
Copy link
Owner

Thanks for the additional information.

@micheleg
Copy link
Owner

You say that there's no problem without the extension. Could you please check if the problem occurs with the extension enabled when you choose the "rise window option" in the click action settings?

@ghost
Copy link

ghost commented Feb 25, 2017

Hmm, It keeps happening :(

@elman22
Copy link

elman22 commented Feb 26, 2017

The bug it's only present when using X11. Wayland it's unaffected. The same happens with dash to panel extension.

This make sense. Touch events on X11 are just an emulation to a pointer event. On Wayland the touch is part of the core input protocol and does not emulate pointer events.

@LuccoJ
Copy link

LuccoJ commented May 1, 2017

For me, too, choosing "Raise window" doesn't solve the problem.

@teohhanhui
Copy link

I switched to Wayland (on Manjaro GNOME) and this bug disappeared (or at least it's much better). But I cannot touch to minimize (touch to restore works though). Click to minimize works fine with the mouse and touchpad.

@PJ-Singh-001
Copy link

Still an issue when using X11.

$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

$ uname -r
4.15.0-32-generic

$ gnome-shell --version
GNOME Shell 3.28.2

@PJ-Singh-001
Copy link

Question:
If we are emulating pointer events, do we know why it seems that two (or more) events are generated in X11?

Also, I only experience this "double" event situation in the Dash. I can interact with windows on the desktop (maximize, minimize, close, etc.) without issue.

I can even interact with the topbar without issue.

However, only the Dash-to-Dock exhibits this issue. (If I disable Dash-to-Dock) I can interact wit the gnome (pop-out) Dash just fine.

Thought:
Perhaps, there is only one emulated pointer event, but its handler is called twice?

@PJ-Singh-001
Copy link

PJ-Singh-001 commented Sep 20, 2018

Another Question...

When an item is selected from the Gnome Dash, how does Gnome Shell know to close the Activities Overview?

Is it because an application has just opened? Or does Gnome Shell handle the touch event twice in some funny way?

I tried a couple of experiments...

Experiment # 1

  1. I disabled the Dash-to-Dock extension.
  2. I opened a terminal, and I entered the following command:
  3. $ sleep 5; gedit
  4. I tapped on the Activities "button" at the top left of my screen to bring up the Gnome-Dash and the Activities-Overview.
  5. I waited about 5 seconds.
  6. Gedit opened automatically, but Activities-Overview did not close.

Obviously, Gnome shell doesn't use the opening of an application as a trigger to close the Activities-Overview.

Experiment # 2

  1. I enabled the Dash-to-Dock extension.
  2. I enabled the Autohide option.
  3. I opened an application (Calculator), and I moved the window near the left edge of the screen, so the Dash would automatically hide.
  4. I tapped on the Activities "button" at the top left of my screen to bring up the Gnome-Dash and the Activities Overview.
  5. I tapped on the gedit icon in my Dash.
  6. Only one instance of Gedit opened!
  7. I closed gedit.
  8. I then moved Calculator away from the left edge of the screen, so the Dash would automatically un-hide.
  9. I tapped on the gedit icon in my Dash.
  10. Two instances of Gedit opened!!

Conclusion

This leads me to believe that Gnome Shell must be handling the touch even in the Dash twice. Once to launch the application, and a second time to close the Activities Overview.

When the Dash is always visible with the Dash-to-Dock extension, perhaps Gnome-Shell calls the Dash's icon-clicked event handler (or whatever it is named) twice?

@3v1n0
Copy link
Collaborator

3v1n0 commented Oct 25, 2018

This is fixed with this: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/272

In the mean time, it can also be workarounded at extension level by doing something like:

diff --git a/appIcons.js b/appIcons.js
@@ -357,6 +367,9 @@ var MyAppIcon = new Lang.Class({
         let modifiers = event ? event.get_state() : 0;
         let focusedApp = tracker.focus_app;
 
+        if (event.type() == Clutter.EventType.TOUCH_END && event.is_pointer_emulated())
+            return;
+
         // Only consider SHIFT and CONTROL as modifiers (exclude SUPER, CAPS-LOCK, etc.)
         modifiers = modifiers & (Clutter.ModifierType.SHIFT_MASK | Clutter.ModifierType.CONTROL_MASK);

@3v1n0
Copy link
Collaborator

3v1n0 commented Nov 26, 2018

This is now fixed for latest gnome-shell and cherry-picked to 3.28 and 3.30.

If there's interest we could fix this at extension level either for older shell versions, it can be done as explained in #196 (comment)

I think we can close the bug here, unless there's interest in workaround the issue at this level.

@3v1n0 3v1n0 closed this as completed Nov 26, 2018
@Freeedim
Copy link

There is still a "double launch" of a touched application in gnome-shell 3.30.1
(On a Lenovo T480 with libinput only)

@CatalinH
Copy link

CatalinH commented Mar 15, 2023

'Double launch' also happens on Ubuntu 22.04, but I don't think it is related to this extenstion. It might be related to this issue and this gnome-shell fix , but $ gnome-shell --version gives me GNOME Shell 42.5. I would have expected to be fixed 🤷‍♂️. Any way those double events can be prevented with the extension? Or any help to debug this would be much appreciated.

@PJ-Singh-001
Copy link

@CatalinH,

I am running 22.10, and I do not experience this issue. I do not recall this being an issue in 22.04, either.

@CatalinH
Copy link

CatalinH commented Mar 15, 2023

@PJ-Singh-001, for me it happened before installing dash-to-dock (I was hoping the extension would fix it), and this happens only on the left side, for the dock. For example, touching the top-right zone (power settings, wifi, sound), it works normally (just opens the pannel).
On the dock has a bit strange behaviour: if the app that I am touching has no opened instance, it opens 2. If it has at least 1, it only focuses on that window.
Asus Zenbook pro duo 14, UX8402ZE, Ubuntu 22.04.2 (LTS) with X11, kernel 5.19.0.35-generic & nvidia 525 driver, and I have the same events TOUCH_DOWN, TOUCH_FRAME, TOUCH_UP, TOUCH_FRAME and some TOUCH_MOTION in between

@DjDiabolik
Copy link

@domolys if you know if this patch it's also work for preventing potential erroneous double click on current Gnome dock in Ubuntu 22.04.4 ?

@domolys
Copy link

domolys commented Apr 3, 2024

@domolys if you know if this patch it's also work for preventing potential erroneous double click on current Gnome dock in Ubuntu 22.04.4 ?

Yes, I patched it on Ubuntu 22.04.4

@DjDiabolik
Copy link

@domolys Sorry for asking but is the default bar on the left of Ubuntu something similar?
If i install this i have to disable the default left bar ?

@domolys
Copy link

domolys commented Apr 8, 2024

This patch only fix issues with touchscreen, it has nothing to do with anythings else...

@DjDiabolik
Copy link

@domolys and couldn't a double tap be similar to a double click?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests