Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.5.1
-
None
-
Linux 4.2.0-gentoo
KWin 5.4.2 (also tested with Mutter 3.16.4)
Qt 5.5.1
xf86-video-intel 2.99.917, Mesa 11.0.3
-
8eaf3352590690079735eda9fb872ec8c9c58f0a
Description
When a window changes its state from hidden to shown some widget gets the focus and focusInEvent fired. But if the mouse pointer is on the position where widget appears, the widget gets the focus but focusInEvent isn't fired.
This happens only on Linux (I tested with kwin and mutter window managers and with various settings of focus stealing).
This doesn't happen on Windows. This also doen't happen on Qt 4.
Steps to reproduce:
1) Build and launch the program from the code attached to this bug:
$ mkdir build
$ cd build
$ cmake ..
$ ./focus_qt5
2) This program shows a QTextEdit widget and hides and shows it every second. Also it handles focusInEvent and focusOutEvent and shows the state of the focus:
void FocusWidget::focusInEvent ( QFocusEvent* event )
{ setText("I have a focus"); setReadOnly(true); qDebug() << "FocusWidget Focus in" << event->reason(); }void FocusWidget::focusOutEvent ( QFocusEvent* event )
{ setText("I don't have a focus"); setReadOnly(false); qDebug() << "FocusWidget Focus out" << event->reason(); }So it shouldn't be possible to change the QTextEdit widget because when it got focus it does setReadOnly(true);
3. Place the mouse cursor inside the window and wait one cycle (2 seconds). Now the widget has a focus, but it is editable and the "I don't have a focus" is inside it. So focusInEvent was missed.
Attachments
For Gerrit Dashboard: QTBUG-49071 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
140112,3 | Fix not delivering focusIn event on hide/show with XCB | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
144899,5 | xcb: Fix not delivering focusIn event on hide/show | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |