def __init__(self): style = wx.DEFAULT_FRAME_STYLE ^ wx.MAXIMIZE_BOX ^ wx.MINIMIZE_BOX | wx.FRAME_NO_TASKBAR super(MainFrame, self).__init__(None, wx.ID_ANY, versionInfo.name, size=(1, 1), style=style) self.Bind(wx.EVT_CLOSE, self.onExitCommand) self.sysTrayIcon = SysTrayIcon(self) #: The focus before the last popup or C{None} if unknown. #: This is only valid before L{prePopup} is called, #: so it should be used as early as possible in any popup that needs it. #: @type: L{NVDAObject} self.prevFocus = None #: The focus ancestors before the last popup or C{None} if unknown. #: @type: list of L{NVDAObject} self.prevFocusAncestors = None # If NVDA has the uiAccess privilege, it can always set the foreground window. if not config.hasUiAccess(): # This makes Windows return to the previous foreground window and also seems to allow NVDA to be brought to the foreground. self.Show() self.Hide() if winUser.isWindowVisible(self.Handle): # HACK: Work around a wx bug where Hide() doesn't actually hide the window, # but IsShown() returns False and Hide() again doesn't fix it. # This seems to happen if the call takes too long. self.Show() self.Hide()
def __init__(self): style = wx.DEFAULT_FRAME_STYLE ^ wx.MAXIMIZE_BOX ^ wx.MINIMIZE_BOX | wx.FRAME_NO_TASKBAR super(MainFrame, self).__init__(None, wx.ID_ANY, versionInfo.name, size=(1,1), style=style) self.Bind(wx.EVT_CLOSE, self.onExitCommand) self.sysTrayIcon = SysTrayIcon(self) #: The focus before the last popup or C{None} if unknown. #: This is only valid before L{prePopup} is called, #: so it should be used as early as possible in any popup that needs it. #: @type: L{NVDAObject} self.prevFocus = None #: The focus ancestors before the last popup or C{None} if unknown. #: @type: list of L{NVDAObject} self.prevFocusAncestors = None # If NVDA has the uiAccess privilege, it can always set the foreground window. if not config.hasUiAccess(): # This makes Windows return to the previous foreground window and also seems to allow NVDA to be brought to the foreground. self.Show() self.Hide() if winUser.isWindowVisible(self.Handle): # HACK: Work around a wx bug where Hide() doesn't actually hide the window, # but IsShown() returns False and Hide() again doesn't fix it. # This seems to happen if the call takes too long. self.Show() self.Hide()