2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 17:15:16 +00:00

Remove not really needed gtk scale factor query

This commit is contained in:
Ilya Fedin
2021-06-26 22:38:22 +04:00
committed by John Preston
parent 0b21c04489
commit 47e32bebe4
5 changed files with 0 additions and 59 deletions

View File

@@ -71,11 +71,6 @@ void GtkIntegration::load() {
LOAD_GTK_SYMBOL(lib, gdk_atom_intern);
LOAD_GTK_SYMBOL(lib, gdk_display_get_default);
LOAD_GTK_SYMBOL(lib, gdk_display_get_monitor);
LOAD_GTK_SYMBOL(lib, gdk_display_get_primary_monitor);
LOAD_GTK_SYMBOL(lib, gdk_monitor_get_scale_factor);
LOAD_GTK_SYMBOL(lib, gdk_pixbuf_get_has_alpha);
LOAD_GTK_SYMBOL(lib, gdk_pixbuf_get_pixels);
LOAD_GTK_SYMBOL(lib, gdk_pixbuf_get_width);
@@ -91,33 +86,6 @@ void GtkIntegration::load() {
Loaded = true;
}
std::optional<int> GtkIntegration::scaleFactor() const {
if ((gdk_display_get_default == nullptr)
|| (gdk_display_get_monitor == nullptr)
|| (gdk_display_get_primary_monitor == nullptr)
|| (gdk_monitor_get_scale_factor == nullptr)) {
return std::nullopt;
}
const auto display = gdk_display_get_default();
if (!display) {
return std::nullopt;
}
const auto monitor = [&] {
if (const auto primary = gdk_display_get_primary_monitor(display)) {
return primary;
}
return gdk_display_get_monitor(display, 0);
}();
if (!monitor) {
return std::nullopt;
}
return gdk_monitor_get_scale_factor(monitor);
}
bool GtkIntegration::showOpenWithDialog(const QString &filepath) const {
return File::internal::ShowGtkOpenWithDialog(filepath);
}