head 1.2; access; symbols pkgsrc-2024Q3:1.1.0.2 pkgsrc-2024Q3-base:1.1; locks; strict; comment @// @; 1.2 date 2024.11.15.13.06.27; author pin; state dead; branches; next 1.1; commitid MnZTSbeycKV48KxF; 1.1 date 2024.08.18.07.44.23; author pin; state Exp; branches; next ; commitid XPEOga47SQBJchmF; desc @@ 1.2 log @wm/obconf-qt: update to 0.16.5 obconf-qt-0.16.5 / 2024-11-01 ============================= * Ported to Qt6 and updated translations. @ text @$NetBSD: patch-src_obconf-qt.cpp,v 1.1 2024/08/18 07:44:23 pin Exp $ Port to Qt6. --- src/obconf-qt.cpp.orig 2024-01-14 11:02:54.000000000 +0000 +++ src/obconf-qt.cpp @@@@ -24,7 +24,6 @@@@ #include #include #include -#include #include #include "maindialog.h" #include @@@@ -124,7 +123,8 @@@@ static gboolean get_all(Window win, Atom gint ret_size; gulong ret_items, bytes_left; - res = XGetWindowProperty(QX11Info::display(), win, prop, 0l, G_MAXLONG, + auto display = qApp->nativeInterface()->display(); + res = XGetWindowProperty(display, win, prop, 0l, G_MAXLONG, FALSE, type, &ret_type, &ret_size, &ret_items, &bytes_left, &xdata); @@@@ -163,7 +163,8 @@@@ static gboolean prop_get_string_utf8(Win gchar* str; guint num; - if(get_all(win, prop, XInternAtom(QX11Info::display(), "UTF8_STRING", 0), 8, (guchar**)&raw, &num)) { + auto display = qApp->nativeInterface()->display(); + if(get_all(win, prop, XInternAtom(display, "UTF8_STRING", 0), 8, (guchar**)&raw, &num)) { str = g_strndup(raw, num); /* grab the first string from the list */ g_free(raw); @@@@ -180,18 +181,19 @@@@ static gboolean prop_get_string_utf8(Win int main(int argc, char** argv) { QApplication app(argc, argv); - app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); // load translations QTranslator qtTranslator, translator; // install the translations built-into Qt itself - qtTranslator.load(QStringLiteral("qt_") + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - app.installTranslator(&qtTranslator); + if(qtTranslator.load(QStringLiteral("qt_") + QLocale::system().name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath))) { + app.installTranslator(&qtTranslator); + } // install our own tranlations - translator.load(QStringLiteral("obconf-qt_") + QLocale::system().name(), QStringLiteral(PACKAGE_DATA_DIR) + QStringLiteral("/translations")); - app.installTranslator(&translator); + if(translator.load(QStringLiteral("obconf-qt_") + QLocale::system().name(), QStringLiteral(PACKAGE_DATA_DIR) + QStringLiteral("/translations"))) { + app.installTranslator(&translator); + } // load configurations @@@@ -204,12 +206,17 @@@@ int main(int argc, char** argv) { paths = obt_paths_new(); parse_i = obt_xml_instance_new(); - int screen = QX11Info::appScreen(); - rrinst = RrInstanceNew(QX11Info::display(), screen); + + auto x11NativeInterface = qApp->nativeInterface(); + auto display = x11NativeInterface->display(); + auto appRootWindow = XDefaultRootWindow(x11NativeInterface->display()); + + int screen = DefaultScreen(display); + rrinst = RrInstanceNew(display, screen); if(!obc_config_file) { gchar* p; - if(prop_get_string_utf8(QX11Info::appRootWindow(screen), - XInternAtom(QX11Info::display(), "_OB_CONFIG_FILE", 0), &p)) { + if(prop_get_string_utf8(appRootWindow, + XInternAtom(display, "_OB_CONFIG_FILE", 0), &p)) { obc_config_file = g_filename_from_utf8(p, -1, NULL, NULL, NULL); g_free(p); } @ 1.1 log @wm/obconf-qt: port to Qt6 Fix build with Qt6 using: https://github.com/lxqt/obconf-qt/pull/230 @ text @d1 1 a1 1 $NetBSD$ @