[vlc-devel] commit: Simplify screen position checking (Ilkka Ollakka )
git version control
git at videolan.org
Thu Oct 16 09:54:32 CEST 2008
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Oct 16 10:53:38 2008 +0300| [c2b6026bd73cd164e86f18bc42b388f4d92d8e91] | committer: Ilkka Ollakka
Simplify screen position checking
screenRec.x() and .y() should be directly those offsets needed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2b6026bd73cd164e86f18bc42b388f4d92d8e91
---
modules/gui/qt4/components/controller.cpp | 24 +++---------------------
1 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 63814ed..2d00903 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -850,29 +850,11 @@ void FullscreenControllerWidget::showFSC()
{
msg_Dbg( p_intf, "Calculation fullscreen controllers center");
/* screen has changed, calculate new position */
- i_screennumber = number;
- int totalCount = QApplication::desktop()->numScreens();
QRect screenRes = QApplication::desktop()->screenGeometry(number);
- int offset_x = 0;
- int offset_y = 0;
- /* Loop all screens to get needed offset_x/y for
- * physical screen center.
- */
- for(int i=0; i <= totalCount ; i++)
- {
- QRect displayRect = QApplication::desktop()->screenGeometry(i);
- if (displayRect.width()+offset_x <= screenRes.x())
- {
- offset_x += displayRect.width();
- }
- if ( displayRect.height()+offset_y <= screenRes.y())
- {
- offset_y += displayRect.height();
- }
- }
- QPoint pos = QPoint( offset_x + (screenRes.width() / 2) - (width() / 2),
- offset_y + screenRes.height() - height());
+ QPoint pos = QPoint( screenRes.x() + (screenRes.width() / 2) - (width() / 2),
+ screenRes.y() + screenRes.height() - height());
move( pos );
+ i_screennumber = number;
}
#ifdef WIN32TRICK
// after quiting and going to fs, we need to call show()
More information about the vlc-devel
mailing list