Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | #include <KWayland/Server/server_decoration_interface.h> | 46 | #include <KWayland/Server/server_decoration_interface.h> | ||
47 | #include <KWayland/Server/qtsurfaceextension_interface.h> | 47 | #include <KWayland/Server/qtsurfaceextension_interface.h> | ||
48 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | 48 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | ||
49 | #include <KWayland/Server/appmenu_interface.h> | 49 | #include <KWayland/Server/appmenu_interface.h> | ||
50 | #include <KWayland/Server/server_decoration_palette_interface.h> | 50 | #include <KWayland/Server/server_decoration_palette_interface.h> | ||
51 | 51 | | |||
52 | #include <KDesktopFile> | 52 | #include <KDesktopFile> | ||
53 | 53 | | |||
54 | #include <QFileInfo> | ||||
54 | #include <QOpenGLFramebufferObject> | 55 | #include <QOpenGLFramebufferObject> | ||
55 | #include <QWindow> | 56 | #include <QWindow> | ||
56 | 57 | | |||
57 | #include <sys/types.h> | 58 | #include <sys/types.h> | ||
58 | #include <unistd.h> | 59 | #include <unistd.h> | ||
59 | #include <signal.h> | 60 | #include <signal.h> | ||
60 | 61 | | |||
61 | using namespace KWayland::Server; | 62 | using namespace KWayland::Server; | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 106 | { | |||
121 | ); | 122 | ); | ||
122 | connect(shellSurface, &T::moveRequested, this, | 123 | connect(shellSurface, &T::moveRequested, this, | ||
123 | [this] { | 124 | [this] { | ||
124 | // TODO: check the seat and serial | 125 | // TODO: check the seat and serial | ||
125 | performMouseCommand(Options::MouseMove, Cursor::pos()); | 126 | performMouseCommand(Options::MouseMove, Cursor::pos()); | ||
126 | } | 127 | } | ||
127 | ); | 128 | ); | ||
128 | 129 | | |||
129 | setResourceClass(shellSurface->windowClass()); | 130 | // determine the resource name, this is inspired from ICCCM 4.1.2.5 | ||
131 | // the binary name of the invoked client | ||||
132 | QFileInfo info{shellSurface->client()->executablePath()}; | ||||
romangg: Could you rename this variable to `fileInfo` or something? There is already a protected `info`… | |||||
I don't think that really matters. the protected Toplevel::info is an X11 only variable which results in a crash when using in ShellClient. So from reading code it is obvious that the Toplevel one cannot be meant as that just doesn't make sense. Also long term plan would be to get rid of the info from Toplevel as it created various problems in the past (and protected variables are evil!) graesslin: I don't think that really matters. the protected Toplevel::info is an X11 only variable which… | |||||
133 | QByteArray resourceName; | ||||
134 | if (info.exists()) { | ||||
135 | resourceName = info.fileName().toUtf8(); | ||||
136 | } | ||||
137 | setResourceClass(resourceName, shellSurface->windowClass()); | ||||
130 | setDesktopFileName(shellSurface->windowClass()); | 138 | setDesktopFileName(shellSurface->windowClass()); | ||
131 | connect(shellSurface, &T::windowClassChanged, this, | 139 | connect(shellSurface, &T::windowClassChanged, this, | ||
132 | [this] (const QByteArray &windowClass) { | 140 | [this, resourceName] (const QByteArray &windowClass) { | ||
133 | setResourceClass(windowClass); | 141 | setResourceClass(resourceName, windowClass); | ||
134 | setDesktopFileName(windowClass); | 142 | setDesktopFileName(windowClass); | ||
135 | } | 143 | } | ||
136 | ); | 144 | ); | ||
137 | connect(shellSurface, &T::resizeRequested, this, | 145 | connect(shellSurface, &T::resizeRequested, this, | ||
138 | [this] (SeatInterface *seat, quint32 serial, Qt::Edges edges) { | 146 | [this] (SeatInterface *seat, quint32 serial, Qt::Edges edges) { | ||
139 | // TODO: check the seat and serial | 147 | // TODO: check the seat and serial | ||
140 | Q_UNUSED(seat) | 148 | Q_UNUSED(seat) | ||
141 | Q_UNUSED(serial) | 149 | Q_UNUSED(serial) | ||
▲ Show 20 Lines • Show All 1555 Lines • Show Last 20 Lines |
Could you rename this variable to fileInfo or something? There is already a protected info member variable in Toplevel, that is inherited to child classes.