Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get window stays on top in plasma wayland??

How to get window stays on top in plasma wayland??

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Newtron
    wrote on last edited by
    #1

    I've been trying to make my window stay on top of all other windows in Plasma Wayland.

    import QtQuick
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
        flags:Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
    }
    

    But id doesn't work. While many other gtk applications are using this feature within plasma wayland. Is there any way to get this thing work.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      seejv
      wrote on last edited by
      #2

      Using Qt5 and possibly KWindowSystem may solve the problem.

      In the KDE Plasma desktop environment, the window manager KWin is responsible for handling and managing windows. When you right-click on a window title bar and select "Keep Above Others", KWin receives a command to make that window stay on top. This is an internal implementation in KWin, and is independent of Qt and QWidget. KWin sets that window to be always on top and adjusts the window stacking order accordingly.

      KWin provides interfaces to interact with other KDE applications and libraries, such as the aforementioned KWindowSystem. Through these interfaces, you can programmatically interact with KWin, such as setting a window to stay on top.

      However, on Wayland, KWin does not provide a D-Bus interface for this functionality. This is why on Wayland, we need to use KWindowSystem, as it abstracts the interaction with the window manager and provides a unified API for both X11 and Wayland. On Wayland, KWindowSystem uses other ways to communicate with KWin instead of D-Bus.

      Therefore, to summarize, in the KDE Plasma desktop environment, KWin is responsible for the "Keep Above Others" functionality. In programming, we can use KWindowSystem (as a higher-level abstraction) to set a window to stay on top. This ensures compatibility between different window managers and display servers.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved