suggestion & PATCH: center shutdown-dialog on screen containing mouse-pointer

Thomas Gahr ml at dadommas.de
Thu Sep 15 17:03:20 BST 2011


Firstly: Aaron, thanks for the clarification!

Secondly: Testcase & Results:

The testcase investigates the following things:
If Qt reacts correctly in case a screen is (dis)connected:
  -QDesktopWidget::screenCountChanged is connected to a slot updating "the 
info labels" (see below)
  -an event-filter is installed on QApplication::desktop() to monitor and log 
resize-events.

"The info labels" display:
  -QDesktopWidget::availableGeometry for screen containing the mouse pointer
  -QDesktopWidget::screenGeometry for screen containing the mouse pointer
  -QDesktopWidget::screenGeometry for the default screen
  -QDesktopWidget::geometry

Results:

QDesktopWidget::availableGeometry & QDesktopWidget::screenGeometry are correct 
- KWin is not to blame :)
QDesktopWidget::geometry is wrong, which can also be seen in the filtered 
QResizeEvents:
connect 2nd screen:    QResizeEvent from 1920x1080 -> 3840x1080
disconnect 2nd screen: QResizeEvent from 3840x1080 -> 3840x1080  !!!

So this seems to be a bug in Qt, I'll file a bug-report there. Maybe other 
users can compile and run the testcase and see if they can confirm the 
behaviour I noticed.

The question is whether a workaround in KDialog::screenRect replacing 
QDesktopWidget::geometry is in order. I think it won't do any harm to use 
QDesktopWidget::screenGeometry(-1) instead - any objections/suggestions?

Cheers,

Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 3935 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110915/18d54981/attachment.cpp>


More information about the kde-core-devel mailing list