Skip to content

Commit

Permalink
X11: Workaround for global shortcuts at start for KDE
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Feb 16, 2017
1 parent e1345dd commit 982cc09
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions qxt/qxtglobalshortcut_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@

namespace {

// This creates first invisible application windows.
void createFirstWindow()
{
static QWidget *w = nullptr;
if (!w) {
w = new QWidget(nullptr, Qt::X11BypassWindowManagerHint);
w->resize(0, 0);
// Try hard so the window is not visible.

// Tool tips won't show in taskbar.
w = new QWidget(nullptr, Qt::ToolTip);

// Move out of screen (if it's not possible to show the window minimized).
w->resize(1, 1);
w->move(-100000, -100000);
w->show();

// Show and hide quickly.
w->showMinimized();
w->hide();
}
}
Expand Down Expand Up @@ -108,7 +116,7 @@ class QxtX11Data {
QxtX11Data()
: m_display(nullptr)
{
// WORKAROUND: There need to be at least one window
// WORKAROUND: There needs to be at least one window
// otherwise we might not get the key press events.
createFirstWindow();

Expand Down

0 comments on commit 982cc09

Please sign in to comment.