1
0
mirror of https://github.com/slgobinath/SafeEyes.git synced 2024-12-29 00:20:28 +01:00

Fix break screen only on one monitor

This commit is contained in:
Gobinath 2017-04-19 10:18:27 -04:00
parent ef863983c1
commit 919dbb234f
4 changed files with 12 additions and 17 deletions

View File

@ -139,21 +139,6 @@ class BreakScreen:
lbl_right = builder.get_object("lbl_right")
img_break = builder.get_object("img_break")
window.move(x, y)
self.windows.append(window)
self.count_labels.append(lbl_count)
# Set visual to apply css theme. It should be called before show method.
window.set_visual(window.get_screen().get_rgba_visual())
window.stick()
window.set_keep_above(True)
window.present()
window.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
window.resize(monitor_gemoetry.width, monitor_gemoetry.height)
window.fullscreen()
# Set values
if image_path:
img_break.set_from_file(image_path)
@ -167,7 +152,17 @@ class BreakScreen:
btn_postpone.set_visible(not self.strict_break)
btn_skip.set_visible(not self.strict_break)
self.windows.append(window)
self.count_labels.append(lbl_count)
# Set visual to apply css theme. It should be called before show method.
window.set_visual(window.get_screen().get_rgba_visual())
window.move(x, y)
window.stick()
window.set_keep_above(True)
window.present()
window.fullscreen()
"""

View File

@ -82,7 +82,7 @@ class Plugins:
Returns: {'left': 'Markup of plugins to be aligned on left', 'right': 'Markup of plugins to be aligned on right' }
"""
context = copy.deepcopy(context) # If plugins change the context, it should not affect Safe Eyes
output = {'left': '', 'right': ''}
output = {'left': ' \n', 'right': ' \n'}
multiple_results = [self.__thread_pool.apply_async(plugin['module'].pre_break, (context,)) for plugin in self.__plugins]
for i in range(len(multiple_results)):
try:
@ -96,7 +96,7 @@ class Plugins:
output[self.__plugins[i]['location']] += (result + '\n\n')
except Exception:
# Something went wrong in the plugin
raise
logging.warning('Error when executing the plugin ' + self.__plugins[i]['name'])
return output

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB