mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-03-26 01:50:05 +00:00
added wayland XCB hack for clipboard
This commit is contained in:
committed by
borgmanJeremy
parent
99493cb8d9
commit
ddd4eb5b0c
17
src/main.cpp
17
src/main.cpp
@@ -51,9 +51,24 @@ int waitAfterConnecting(int delay, QCoreApplication& app)
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
// source: https://github.com/ksnip/ksnip/issues/416
|
||||
void wayland_hacks()
|
||||
{
|
||||
// Workaround to https://github.com/ksnip/ksnip/issues/416
|
||||
QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
|
||||
QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
|
||||
QByteArray sessionType = qgetenv("XDG_SESSION_TYPE").toLower();
|
||||
if (sessionType.contains("wayland") && (currentDesktop.contains("gnome") ||
|
||||
sessionDesktop.contains("gnome"))) {
|
||||
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
wayland_hacks();
|
||||
#endif
|
||||
spdlog::set_level(spdlog::level::debug); // Set global log level to debug
|
||||
spdlog::set_pattern("[source %s] [function %!] [line %#] %v");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user