mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
add --no-fractional arg
This commit is contained in:
parent
577c9297c3
commit
0c2386861a
3 changed files with 10 additions and 3 deletions
|
@ -37,6 +37,7 @@ public:
|
||||||
|
|
||||||
bool m_bIPCEnabled = true;
|
bool m_bIPCEnabled = true;
|
||||||
std::string m_szExplicitConfigPath;
|
std::string m_szExplicitConfigPath;
|
||||||
|
bool m_bNoFractionalScale = false;
|
||||||
|
|
||||||
void removeOldHyprpaperImages();
|
void removeOldHyprpaperImages();
|
||||||
void preloadAllWallpapersFromConfig();
|
void preloadAllWallpapersFromConfig();
|
||||||
|
|
|
@ -121,7 +121,7 @@ void Events::handleGlobal(void *data, struct wl_registry *registry, uint32_t nam
|
||||||
g_pHyprpaper->createSeat((wl_seat*)wl_registry_bind(registry, name, &wl_seat_interface, 1));
|
g_pHyprpaper->createSeat((wl_seat*)wl_registry_bind(registry, name, &wl_seat_interface, 1));
|
||||||
} else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
|
} else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
|
||||||
g_pHyprpaper->m_sLayerShell = (zwlr_layer_shell_v1*)wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 1);
|
g_pHyprpaper->m_sLayerShell = (zwlr_layer_shell_v1*)wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 1);
|
||||||
} else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0) {
|
} else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0 && !g_pHyprpaper->m_bNoFractionalScale) {
|
||||||
g_pHyprpaper->m_sFractionalScale = (wp_fractional_scale_manager_v1*)wl_registry_bind(registry, name, &wp_fractional_scale_manager_v1_interface, 1);
|
g_pHyprpaper->m_sFractionalScale = (wp_fractional_scale_manager_v1*)wl_registry_bind(registry, name, &wp_fractional_scale_manager_v1_interface, 1);
|
||||||
} else if (strcmp(interface, wp_viewporter_interface.name) == 0) {
|
} else if (strcmp(interface, wp_viewporter_interface.name) == 0) {
|
||||||
g_pHyprpaper->m_sViewporter = (wp_viewporter*)wl_registry_bind(registry, name, &wp_viewporter_interface, 1);
|
g_pHyprpaper->m_sViewporter = (wp_viewporter*)wl_registry_bind(registry, name, &wp_viewporter_interface, 1);
|
||||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -7,14 +7,19 @@ int main(int argc, char** argv, char** envp) {
|
||||||
|
|
||||||
// parse some args
|
// parse some args
|
||||||
std::string configPath;
|
std::string configPath;
|
||||||
|
bool noFractional = false;
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) && argc >= i + 2) {
|
if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) && argc >= i + 2) {
|
||||||
configPath = std::string(argv[++i]);
|
configPath = std::string(argv[++i]);
|
||||||
Debug::log(LOG, "Using config location %s.", configPath.c_str());
|
Debug::log(LOG, "Using config location %s.", configPath.c_str());
|
||||||
|
} else if (!strcmp(argv[i], "--no-fractional") || !strcmp(argv[i], "-n")) {
|
||||||
|
noFractional = true;
|
||||||
|
Debug::log(LOG, "Disabling fractional scaling support!");
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Hyprpaper usage: hyprpaper [arg [...]].\n\nArguments:\n" <<
|
std::cout << "Hyprpaper usage: hyprpaper [arg [...]].\n\nArguments:\n" <<
|
||||||
"--help -h | Show this help message\n" <<
|
"--help -h | Show this help message\n" <<
|
||||||
"--config -c | Specify config file to use\n";
|
"--config -c | Specify config file to use\n" <<
|
||||||
|
"--no-fractional -n | Disable fractional scaling support\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +27,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
// starts
|
// starts
|
||||||
g_pHyprpaper = std::make_unique<CHyprpaper>();
|
g_pHyprpaper = std::make_unique<CHyprpaper>();
|
||||||
g_pHyprpaper->m_szExplicitConfigPath = configPath;
|
g_pHyprpaper->m_szExplicitConfigPath = configPath;
|
||||||
|
g_pHyprpaper->m_bNoFractionalScale = noFractional;
|
||||||
g_pHyprpaper->init();
|
g_pHyprpaper->init();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue