[vlc-devel] commit: QT4: compare also screengeometry to see if screenresolution has changed ( Ilkka Ollakka )

git version control git at videolan.org
Sat Jan 24 00:33:13 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Jan 24 01:29:49 2009 +0200| [e3d4f31484fc4f03e749ed4166aa7fc5cefd739c] | committer: Ilkka Ollakka 

QT4: compare also screengeometry to see if screenresolution has changed
 when checking if fullscreencontrollers position needs to be
 recalculated. Should fix #2283 (what I understand that ticket)

 Please review and test.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e3d4f31484fc4f03e749ed4166aa7fc5cefd739c
---

 modules/gui/qt4/components/controller.cpp |    5 +++--
 modules/gui/qt4/components/controller.hpp |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 67d7d24..fc9f876 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -699,11 +699,12 @@ void FullscreenControllerWidget::showFSC()
     adjustSize();
     /* center down */
     int number = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
-    if( number != i_screennumber )
+    if( number != i_screennumber ||
+        screenRes != QApplication::desktop()->screenGeometry(number) )
     {
+        screenRes = QApplication::desktop()->screenGeometry(number);
         msg_Dbg( p_intf, "Calculation fullscreen controllers center");
         /* screen has changed, calculate new position */
-        QRect screenRes = QApplication::desktop()->screenGeometry(number);
         QPoint pos = QPoint( screenRes.x() + (screenRes.width() / 2) - (width() / 2),
                              screenRes.y() + screenRes.height() - height());
         move( pos );
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 3446c38..65b8a37 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -264,6 +264,7 @@ private:
     int i_mouse_last_x, i_mouse_last_y;
     bool b_mouse_over;
     int i_screennumber;
+    QRect screenRes;
 
 #ifdef WIN32TRICK
     bool b_fscHidden;




More information about the vlc-devel mailing list