Skip to content

Commit 6821981

Browse files
committed
Disable immediate frontend on Windows
It seems that this is no longer supported on Windows, so better switch the default frontend to one that actually works there. Closes #12
1 parent 65b7319 commit 6821981

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/path_registry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
void PathRegistry::add_path(Path p) {
44
paths.emplace_back(p);
55
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
6-
if (!quartz::util::is_wayland()) {
6+
if (Settings::get()->supportsImmediate()) {
77
// if no other frontend was explicitly selected,
88
// we could begin an immediate drag now (once startup is complete)
99
Settings::get()->can_drag_immediately = true;

src/settings.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#include "settings.hpp"
22

3+
bool Settings::supportsImmediate() const {
4+
#if defined(Q_OS_WIN)
5+
return false;
6+
#endif
7+
return !quartz::util::is_wayland();
8+
}
9+
310
void Settings::setAlwaysOnBottom(const bool v) {
411
if (!suppress_always_on_bottom) {
512
always_on_bottom = v;
@@ -13,7 +20,7 @@ Settings::Frontend Settings::effective_frontend(bool outgoing) const {
1320
} else if (frontend == Settings::Frontend::Auto) {
1421
if (intercept) {
1522
// for intercept and outgoing prefer Immediate as default frontend
16-
return quartz::util::is_wayland() ? Settings::Frontend::Stdout : Settings::Frontend::Immediate;
23+
return supportsImmediate() ? Settings::Frontend::Immediate : Settings::Frontend::Stdout;
1724
} else {
1825
// in general (not outgoing), prefer immediate and fallback to GUI
1926
return can_drag_immediately ? Settings::Frontend::Immediate : Settings::Frontend::Gui;

src/settings.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Settings : public QObject {
3535

3636
AutoQuitBehavior auto_quit_behavior = Settings::AutoQuitBehavior::All;
3737
Frontend frontend = Settings::Frontend::Auto;
38+
bool supportsImmediate() const;
3839
void setAlwaysOnBottom(const bool v);
3940
Frontend effective_frontend(bool outgoing = false) const;
4041
void setHideGui(const bool h);

0 commit comments

Comments
 (0)