[vlc-commits] [Git][videolan/vlc][3.0.x] Fix the playback bar is not aligned to the bottom in the FSM on Linux

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Jun 17 09:19:19 UTC 2022



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
d68b590f by Eugene Popov at 2022-06-14T11:09:28+03:00
Fix the playback bar is not aligned to the bottom in the FSM on Linux

The reason why the playback panel is not aligned to the bottom in fullscreen mode on Linux is because the desktop environment panels (like taskbar, topbar, etc.) set `struts` that limit the area over which the top-level window can be moved programmatically. To get around this, we need to tell the window to ignore window manager hints (by setting the Qt::X11BypassWindowManagerHint flag) and manually limit its movement.

BUG: 22563

- - - - -


1 changed file:

- modules/gui/qt/components/controller.cpp


Changes:

=====================================
modules/gui/qt/components/controller.cpp
=====================================
@@ -812,7 +812,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
 
     vout.clear();
 
-    setWindowFlags( Qt::Tool | Qt::FramelessWindowHint );
+    setWindowFlags( Qt::Tool | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint );
     setAttribute( Qt::WA_ShowWithoutActivating );
     setMinimumWidth( FSC_WIDTH );
     isWideFSC = false;
@@ -1088,7 +1088,12 @@ void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
         int i_moveX = event->globalX() - i_mouse_last_x;
         int i_moveY = event->globalY() - i_mouse_last_y;
 
-        move( x() + i_moveX, y() + i_moveY );
+        const QRect screenRect = QApplication::desktop()->screenGeometry( targetScreen() );
+
+        const int i_x = qBound( screenRect.left(), x() + i_moveX, screenRect.right() - width() );
+        const int i_y = qBound( screenRect.top(),  y() + i_moveY, screenRect.bottom() - height() );
+
+        move( i_x, i_y );
 
         i_mouse_last_x = event->globalX();
         i_mouse_last_y = event->globalY();



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d68b590f6735436e54ab717e7b47de881bdacb2b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d68b590f6735436e54ab717e7b47de881bdacb2b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list