GTK+ applications unable to be clicked on in Unity 8

Bug #1388875 reported by Sebastien Bacher on 2014-11-03
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gtk+3.0 (Ubuntu)
High
Robert Ancell
Utopic
High
Robert Ancell
Vivid
High
Robert Ancell

Bug Description

[Impact]
GTK+ applications running in Unity 8 do not respond to button presses. This is due to Unity 8 / Mir changing the way events are generated (from mouse events to touch events). The GTK+ backend did not interpret these touch events.

[Test Case]
1. Set up a GTK+ application to be launchable from Unity 8 (i.e. edit a .desktop file and set X-Ubuntu-Touch=true)
2. Log into a Unity 8 session
3. Click on a button in the application
Expected result:
The button is pressed
Observed result:
Nothing happens when clicking on the button

[Regression Potential]
Low. The fix is just to handle the case of a pointer up/down event where no buttons are specified. This was previously ignored. The GTK+ backend is not usable without making hacks so this is unlikely to affect other GTK+ users.

Sebastien Bacher (seb128) wrote :
tags: added: gtk-mir
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtk+3.0 (Ubuntu):
status: New → Confirmed
Robert Ancell (robert-ancell) wrote :

I can confirm this happening with the utopic package but not with the origional wip/mir git branch.

Robert Ancell (robert-ancell) wrote :

Confirmed this is occurring in git master - suspecting that something changed inside GTK+.

Changed in gtk+3.0 (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
status: Confirmed → Triaged
Robert Ancell (robert-ancell) wrote :

Note you can enable event debugging to stderr by running with GDK_MIR_LOG_EVENTS=true

Robert Ancell (robert-ancell) wrote :

There seems to be an issue with the GTK+ Mir surface getting focus.

When running through mir_demo_server_shell no mouse up/down events are received (as shown using GDK_MIR_LOG_EVENTS). However, if you drag the window using alt+mouse then release the events work after that. I can then run the demo program using both git master and the utopic version of GTK+. When I said it was working with wip/mir in comment 3 I think I might just have accidentally given the window focus when testing.

When I run in Unity 8 it still doesn't work which makes me think now that for some reason the surface doesn't have focus.

Robert Ancell (robert-ancell) wrote :

Aha, this is the issue. Below is an event from running inside Unity 8. We are getting up and down events but they don't have a button state (they appear to be finger events). So we're not going to generate a GDK event for this. Unity 8 must have switched from generating mouse events to finger events (even though I am using a mouse).

MOTION
 Device 0
 Source 4098
 Action down
 Flags
 Modifiers
 Edge Flags 0
 Button State
 Offset (0.000000, 0.000000)
 Precision (0.100000, 0.100000)
 Down Time 0
 Event Time 1415159489613000000
 Pointer Coordinates
  ID=0 location=(633.000000, 285.000000) raw=(633.000000, 285.000000) touch=(0.000000, 0.000000) size=0.000000 pressure=0.781250 orientation=0.000000 s
croll=(0.000000, 0.000000) tool=finger

Robert Ancell (robert-ancell) wrote :

I think the fix is:

--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -311,7 +313,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
     case mir_motion_action_up:
       event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
       changed_button_state = button_state ^ event->button_state;
- if ((changed_button_state & mir_motion_button_primary) != 0)
+ if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
         generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
       if ((changed_button_state & mir_motion_button_secondary) != 0)
         generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);

I'm EOD - will pick this up tomorrow unless someone else wants to look at it.

Changed in gtk+3.0 (Ubuntu Utopic):
status: New → Triaged
importance: Undecided → High
summary: - [gtk-mir-backend] Clicking seems to confuse GTK (or the shell)
+ GTK+ applications unable to be clicked on in Unity 8
Changed in gtk+3.0 (Ubuntu Utopic):
assignee: nobody → Robert Ancell (robert-ancell)
description: updated
description: updated
Changed in gtk+3.0 (Ubuntu Utopic):
status: Triaged → Fix Committed
Changed in gtk+3.0 (Ubuntu Vivid):
status: Triaged → Fix Committed

Hello Sebastien, or anyone else affected,

Accepted gtk+3.0 into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gtk+3.0/3.12.2-0ubuntu15.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Launchpad Janitor (janitor) wrote :
Download full text (7.9 KiB)

This bug was fixed in the package gtk+3.0 - 3.14.6-0ubuntu1

---------------
gtk+3.0 (3.14.6-0ubuntu1) vivid; urgency=medium

  [ Lars Uebernickel ]
  * New upstream release
  * debian/patches/0001-Disable-deprecation-warnings-in-tests.patch,
    debian/patches/0001-Fight-deprecation-warnings-in-test.patch,
    debian/patches/0001-threads-Do-not-release-the-GDK-lock-if-it-hasn-t-bee.patch,
    debian/patches/git-gtkpopover-set-background-and-popover-css.patch,
    debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch,
    debian/patches/git_printing_segfault.patch,
    debian/patches/git_reftests-Improve-workaround-for-GtkGrid-bug.patch,
    debian/patches/gtkaboutdialog-support-showing-buttons-in-action-are.patch,
    debian/patches/gtkdialog-don-t-use-csd-when-use-header-bar-is-FALSE.patch,
    debian/patches/ubuntu_label_wrap_workaround.patch,
    debian/patches/ubuntu_translation_template.patch,
    debian/patches/use-secrets-service-for-cups-auth_info.patch:
    - dropped, included in the new release
  * debian/patches/022_disable-viqr-im-for-vi-locale.patch:
    - dropped, unlikely that we still need it
  * debian/patches/016_no_offscreen_widgets_grabbing.patch,
    debian/patches/017_no_offscreen_device_grabbing.patch,
    debian/patches/018_gdkenumtypes.c_location.patch,
    debian/patches/032_mips_treeview_row_separator_height.patch,
    debian/patches/073_treeview_almost_fixed.patch,
    debian/patches/074_eventbox_scroll_mask.patch,
    debian/patches/bzg_gtkcellrenderer_grabbing_modifier.patch,
    debian/patches/message-dialog-restore-traditional-look-on-unity.patch,
    debian/patches/mir-backend.patch,
    debian/patches/print-dialog-show-options-of-remote-dnssd-printers.patch,
    debian/patches/ubuntu_gtk_custom_menu_items.patch,
    debian/patches/x-canonical-accel.patch,
    debian/patches/mir-backend.patch:
    - ported and refreshed
  * 030_tests_skip_filechooser.patch,
    042_treeview_single-focus.patch,
    043_notebook_scroll.patch:
    - disable, it's not clear why this is needed anymore (as Debian did)

  [ Iain Lane ]
  * Merge with Debian. Remaining changes:
    + Enable Mir backend.
    + Set Multi-Arch: same on the library.
    + Drop 061_multiarch_module_fallback.patch - unneeded in Ubuntu since we
      cleared all old gtk modules out.
    + Install the settings.ini file to set our themes.
    + Ubuntu specific patches:
      - 073_treeview_almost_fixed.patch
      - 074_eventbox_scroll_mask.patch
      - bzg_gtkcellrenderer_grabbing_modifier.patch
      - ubuntu_gtk_custom_menu_items.patch
      - print-dialog-show-options-of-remote-dnssd-printers.patch
      - uimanager-guard-against-nested-node-updates.patch
      - x-canonical-accel.patch
      - message-dialog-restore-traditional-look-on-unity.patch
  * Don't depend on the adwaita icon theme
  * 0001-Menu-items-force-loading-16x16-icons.patch: Scale icons in menu items
    to 16x16
  * debian/control{,.in}: Version the libmirclient-dev dependency to ≥ 0.90,
    on request of Rico who maintains backports of this package in a PPA.
  * New upstream release.

  [ Robert Ancell ]
  * debian/patches/mir-backend.patch:
    - Add back changes fr...

Read more...

Changed in gtk+3.0 (Ubuntu Vivid):
status: Fix Committed → Fix Released
Sebastien Bacher (seb128) wrote :

seems to work as it should

tags: added: verification-done
removed: verification-needed

The verification of the Stable Release Update for gtk+3.0 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.12.2-0ubuntu15.2

---------------
gtk+3.0 (3.12.2-0ubuntu15.2) utopic; urgency=medium

  * debian/patches/mir-backend.patch:
    - Fix touch events not generating GDK events (LP: #1388875)
 -- Robert Ancell <email address hidden> Thu, 06 Nov 2014 09:51:49 +1300

Changed in gtk+3.0 (Ubuntu Utopic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers