diff --git a/src/main.cpp b/src/main.cpp index 446d649..fd8ecb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,15 @@ int main(int argc, char *argv[]) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) +// SideBarApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif + QCoreApplication::setApplicationName("ukui-menu"); QCoreApplication::setOrganizationName("ukui"); QCoreApplication::setOrganizationDomain("ukui.org"); diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index ce362ef..28a4a5d 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -99,7 +99,7 @@ void WindowHelper::setWindowAttribute(QWindow *window) } // kwin - KWindowSystem::setType(window->winId(), NET::Notification); + KWindowSystem::setType(window->winId(), NET::Normal); KWindowSystem::setState(window->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); if (!QX11Info::isPlatformX11()) { // wayland环境 设置跳过多任务视图,设置跳过任务栏s @@ -240,8 +240,13 @@ void WindowGeometryHelper::updateGeometry() int height = MenuSetting::instance()->get(MENU_HEIGHT).toInt(); int margin = MenuSetting::instance()->get(MENU_MARGIN).toInt(); - width = width > screenRect.width() ? screenRect.width() : width; - height = height > screenRect.height() ? screenRect.height() : height; + if (width > screenRect.width()) { + width = screenRect.width(); + } + if (height > screenRect.height()) { + height = screenRect.height(); + } + //上: 1, 下: 0, 左: 2, 右: 3 switch (m_panelPos) { @@ -388,6 +393,7 @@ void MenuWindow::init() setColor("transparent"); // setFlags(Qt::FramelessWindowHint); + setFlag(Qt::WindowStaysOnTopHint); WindowHelper::setWindowAttribute(this); WindowHelper::removeHeaderBar(this); WindowHelper::windowBlur(this, true);