Don't show initial display window if on same screen as application window, override or not.

This commit is contained in:
Jonathan Corwin 2011-12-23 14:38:02 +00:00
parent 69490c8f2c
commit 3a5723cbaa
2 changed files with 16 additions and 1 deletions

View File

@ -222,6 +222,20 @@ class ScreenList(object):
log.debug(u'reset_current_display')
self.set_current_display(self.current[u'number'])
def which_screen(self, window):
"""
Return the Screen number that the centre of the passed window is in
Window is a QWidget
"""
x = window.x() + (window.width() / 2)
y = window.y() + (window.height() / 2)
for screen in self.screen_list:
size = screen[u'size']
if x >= size.x() and x <= (size.x() + size.width()) \
and y >= size.y() and y <= (size.y() + size.height()):
return screen[u'number']
return None
def _load_screen_settings(self):
"""
Loads the screen size and the monitor number from the settings.

View File

@ -956,7 +956,8 @@ class SlideController(Controller):
display_type = QtCore.QSettings().value(
self.parent().generalSettingsSection + u'/screen blank',
QtCore.QVariant(u'')).toString()
if not self.display.primary:
if self.screens.which_screen(self.window()) != \
self.screens.which_screen(self.display):
# Order done to handle initial conversion
if display_type == u'themed':
self.onThemeDisplay(True)