Commit 194da254 authored by dmMaze's avatar dmMaze
Browse files

fix headless mode

parent 619bee21
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ from xcffib.xproto import (ButtonIndex, ButtonMask, ButtonReleaseEvent,
                           ClientMessageData, ClientMessageEvent, EventMask,
                           xprotoExtension)

from utils import shared

class WindowMessage(Enum):
    """ Window message enum class """
@@ -155,3 +156,12 @@ class LinuxMoveResize:
            Qt.RightEdge: WindowMessage._NET_WM_MOVERESIZE_SIZE_RIGHT,
        }
        cls.startSystemMoveResize(window, globalPos, messageMap[edges].value)

    @classmethod
    def toggleMaxState(cls, window):
        if shared.HEADLESS:
            return
        if window.isMaximized():
            window.showNormal()
        else:
            window.showMaximized()
 No newline at end of file
+11 −1
Original line number Diff line number Diff line
# coding: utf-8

from utils import shared

class LinuxMoveResize:
    """ Tool class for moving and resizing window """
@@ -25,3 +26,12 @@ class LinuxMoveResize:
            window edges
        """
        window.windowHandle().startSystemResize(edges)

    @classmethod
    def toggleMaxState(cls, window):
        if shared.HEADLESS:
            return
        if window.isMaximized():
            window.showNormal()
        else:
            window.showMaximized()
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ from Quartz.CoreGraphics import (CGEventCreateMouseEvent,

QT_VERSION = tuple(int(v) for v in qVersion().split('.'))

from utils import shared

class MacMoveResize:
    """ Tool class for moving and resizing Mac OS window """
@@ -62,6 +63,8 @@ class MacMoveResize:

    @classmethod
    def toggleMaxState(cls, window):
        if shared.HEADLESS:
            return
        if window.isMaximized():
            window.showNormal()
        else:
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ from qtpy import API
USE_PYSIDE6 = API == 'pyside6'
QT_VERSION = tuple(int(v) for v in qVersion().split('.'))

from utils import shared


def getSystemAccentColor():
    """ get the accent color of system
@@ -397,6 +399,8 @@ class WindowsMoveResize:

    @classmethod
    def toggleMaxState(cls, window):
        if shared.HEADLESS:
            return
        if QT_VERSION < (6, 8, 0):
            if window.isMaximized():
                window.showNormal()