Bug 1188289

Summary: Wayland: GTK+ combo box does not update selected item with x11 backend
Product: [Fedora] Fedora Reporter: Olivier Fourdan <ofourdan>
Component: waylandAssignee: Adam Jackson <ajax>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: ajax, mclasen, rmatos, sergio
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 08:25:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
characters overlapped
none
example: one letter of a font disappear none

Description Olivier Fourdan 2015-02-02 14:32:44 UTC
Description of problem:

Using GTK (either gtk3-3.14.6 or gtk2-2.24.25) with x11 backend (default in Fedora weven under Wayland session), it's difficult to select items from the combo box because the selection of items does not follow the pointer.

Version-Release number of selected component (if applicable):

gtk2-2.24.25-1.fc21.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Run "GDK_BACKEND=x11 gtk3-demo"
   or "GDK_BACKEND=x11 gtk-demo"
2. Choose "Combo boxes from the list"
3. Try to select items in the combo boxes

Actual results:

Only the initial item remains hilighted, even though the selection actually works.

Expected results:

The hilighted item follows the mouse pointer.

Additional info:

The same works with the wayland backend: GDK_BACKEND=wayland gtk3-demo

But not gtk2, the following will not work even with wayland backend: ""

  GDK_BACKEND=wayland gtk3-demo  => OK
  GDK_BACKEND=x11 gtk3-demo      => Fail
  GDK_BACKEND=wayland gtk-demo   => Fail
  GDK_BACKEND=x11 gtk-demo       => Fail

This makes it impossible to select in cascading menus for example.

Comment 1 Matthias Clasen 2015-02-13 17:37:49 UTC
if it works under actual X, but not under xwayland, I'd tend to say it is a bug in the X emulation under wayland.

Comment 2 Olivier Fourdan 2015-02-18 09:41:33 UTC
I think you're right, it's not gtk specific and affects different toolkits (gtk2, Motif, Xaw).

There are other similar reports, bug 1148202 and bug 1148020 but these are all closed (although the issue seems to be still there).

Worth noting that the issue occurs only when the mouse button is kept pressed, so menus that rely on "press => select => release" won't work (e.g. Xaw or gtk2 combobox) whereas the menus which can operate with "press => release => select/hover => press => release" do work.

The enter/leave notify events are reported though (as seen with xev) but the detail field may differ, it seems the NotifyNonlinear is not reported in the case of XWayland, I dunno if the toolkits rely on that, but I will check.

Comment 3 Olivier Fourdan 2015-02-18 11:05:31 UTC
Now it gets weird, if the mouse button is pressed, the xany.window field of the events is differs...

gtk uses that to identify the widget associated with the event (I reckon other toolkits do th same), and when a button is pressed, the function gtk_get_event_widget() will return NULL as it can't find the widget matching the events.

Comment 4 Olivier Fourdan 2015-02-18 14:21:22 UTC
Xwayland computes to window event in xwl_xy_to_window() (in hw/xwayland/xwayland-input.c) based on the seat's focus_window.

It appears that the seat's focus_window remains on the window where the mouse button was initially pressed as long as the button is pressed, which explains why the toolkits which rely on the window field of the enter/leave and motion notify events do not update the selected item when the mouse button is kept pressed.

I am not sure if and how this could be fixed though.

Comment 5 Rui Matos 2015-02-19 09:52:08 UTC
Jasper's patch at http://patchwork.freedesktop.org/patch/42742/ should fix this

Comment 7 Olivier Fourdan 2015-02-23 14:49:01 UTC
That patch works better actually: http://patchwork.freedesktop.org/patch/43021/

Comment 8 Sergio Basto 2015-05-15 12:04:43 UTC
*** Bug 1188490 has been marked as a duplicate of this bug. ***

Comment 9 Sergio Basto 2015-05-15 12:27:19 UTC
I use a kde windows manager . 
when I choose gtk+ appearance -> gtk+ style (you need install kcm-gtk to have this option )  -> oxygen-gtk 

GDK_BACKEND=x11 gtk3-demo 
run Combo boxes from the list
Try to select items in the combo boxes , it freeze all desktop until I press esc ( to return) 

GDK_BACKEND=wayland gtk3-demo 

(gtk3-demo:3566): Gtk-WARNING **: cannot open display: :0


GDK_BACKEND=wayland gtk-demo
seems to work 

GDK_BACKEND=x11 gtk-demo 
also seems to work 


changing gtk+ style -> adwaita 
GDK_BACKEND=x11 gtk3-demo 
don't have problem .

BTW : I'm try hunting a bug , on rendering graphics that sometimes fails , since the begging of F21 , I found that only happens with gtk+ applications , sometimes one letter of a font disappears , sometime I got corrupt graphics , but a refresh window fix it .
Other where this bug place is visible is on libreoffice characters overlaps , I'm sending a picture in attach . 

Thanks

Comment 10 Sergio Basto 2015-05-15 12:29:38 UTC
Created attachment 1025826 [details]
characters overlapped

Comment 11 Olivier Fourdan 2015-05-15 12:40:08 UTC
(In reply to Sergio Monteiro Basto from comment #9)
> BTW : I'm try hunting a bug , on rendering graphics that sometimes fails ,
> since the begging of F21 , I found that only happens with gtk+ applications
> , sometimes one letter of a font disappears , sometime I got corrupt
> graphics , but a refresh window fix it .
> Other where this bug place is visible is on libreoffice characters overlaps
> , I'm sending a picture in attach . 

I would prefer not to confuse everything, this particular bug 1188289 is about XWayland and override-redirect windows, and there is a known fix available (see comment 7).

Anything else (like libreoffice characters overlaps) would belong to a separate bug.

Comment 12 Sergio Basto 2015-05-15 12:57:27 UTC
Created attachment 1025835 [details]
example: one letter of a font disappear

well this bug is the closest thing that I found . But we could ignore my comments, I just wrote to record , I don't know what component is failing , so maybe someone can help me out . 

Thanks,

Comment 13 Sergio Basto 2015-05-19 14:14:01 UTC
Hi, as this bug is assign to Ajax , I'm writing here because is the closest report that I found and I don't know where to write. 
The problems couldn't be the same but, in common, they are in Fedora 21 and with GTK. I investigate a little bit, kde plasma doesn't run on wayland, I have the problems described in #9, #11 and #12 since I upgrade to F21 but I can't find any warning or error message that could give me a clue of what happens. I know for a fact, if I restart X (close session and login again) the problem of missing font characters goes but libreoffice characters overlaps I think don't . 
Other common characteristic, only happens with gtk+ applications and both have problems with combo boxes, I even sometimes have some graphics corruptions on apps and changing gtk appearance -> widget style (oxygen , QtCurve or adwaita ) doesn't make any difference .

Comment 14 Olivier Fourdan 2015-05-19 14:46:47 UTC
(In reply to Sergio Monteiro Basto from comment #13)
> Hi, as this bug is assign to Ajax , I'm writing here because is the closest
> report that I found and I don't know where to write.

Please open a different bug for your issue, it definitely sounds like a different problem from this one.

> The problems couldn't be the same but, in common, they are in Fedora 21 and
> with GTK.

Precisely, it's not because it's Fedora and gtk that it has to be *this* bug. One problem, one bug (otherwise we would have only one bug for all existing issues, wouldn't be very practical, would it?).

> I investigate a little bit, kde plasma doesn't run on wayland, I
> have the problems described in #9, #11 and #12 since I upgrade to F21 but I
> can't find any warning or error message that could give me a clue of what
> happens. I know for a fact, if I restart X (close session and login again)
> the problem of missing font characters goes but libreoffice characters
> overlaps I think don't .

Definitely a different issue. Trying to hijack a particular bug with a fix available already won't drive your issue to resolution any faster, quite the opposite as it just adds confusion.

> Other common characteristic, only happens with gtk+ applications and both
> have problems with combo boxes, I even sometimes have some graphics
> corruptions on apps and changing gtk appearance -> widget style (oxygen ,
> QtCurve or adwaita ) doesn't make any difference .

Comment 15 Fedora End Of Life 2015-11-04 11:54:36 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 Fedora  'version'
of '21'.

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

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 16 Fedora End Of Life 2015-12-02 08:26:01 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.