我创建了一个Qt排序器示例,QML代码如下所示:
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.0
import QtWayland.Compositor 1.0
WaylandCompositor{
id:comp
WaylandOutput{
compositor:comp
sizeFollowsWindow:true
window:Window{
visible:true
width:700
height:700
Repeater{
model:shellSurfaces
ShellSurfaceItem{
shellSurface:modelData
onSurfaceDestroyed:shellSurfaces.remove(index)
}
}
}
}
ListModel{id:shellSurfaces}
WlShell{
onWlShellSurfaceCreated:{
shellSurfaces.append({shellSurface:shellSurface});
}
}
}我知道我可以在命令之后使用--platform wayland打开一个摇摇欲坠的窗口。如何在Wayland排序器(例如Firefox)中打开其他软件窗口?
(我不知道显示服务器和Wayland作曲家的基本知识。我认为我创建的排序器就像一个窗口管理器,我在其中打开的应用程序应该像在窗口管理器中打开一样,在排序器中打开)。
发布于 2022-01-24 20:20:26
当您的排序器加载时,它会在计算机上创建一个套接字。在我的机器上,它位于/run/user/1000。它应该命名为类似于0-wayland。
为了启动一个应用程序,您需要通过一个环境变量将wayland显示传递给它。
示例:
启动火狐:WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_TYPE="wayland" firefox
启动kcalc(KDE计算器):WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_TYPE="wayland" kcalc
我想你知道这个主意了。
https://stackoverflow.com/questions/69964352
复制相似问题