Mauszeiger ausschaltbar bei Vollbildanzeige z.B. für Touch

This commit is contained in:
Thomas Hooge 2025-07-03 11:18:23 +02:00
parent 013cd5f5e9
commit e94f6df408
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ deviceid = 100
simulation = on
histpath = ~/.local/lib/obp60
guistyle = fullscreen
mouseptr = off
[bme280]
enabled = true

View File

@ -285,6 +285,7 @@ class Frontend(Gtk.Window):
self.owndev = device
self.boatdata = boatdata
self._fullscreen = cfg['guistyle'] == 'fullscreen'
self._mouseptr = cfg['mouseptr']
self.connect("destroy", self.on_destroy)
@ -351,6 +352,11 @@ class Frontend(Gtk.Window):
print("Wische von 2 nach 1 für Programmende")
def on_realize(self, widget):
if self._fullscreen and not self._mouseptr:
# Mauszeiger ggf. ausschalten
self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
def run(self):
GLib.timeout_add_seconds(2, self.on_timer)
self.show_all()
@ -586,6 +592,7 @@ if __name__ == "__main__":
cfg['simulation'] = config.getboolean('system', 'simulation')
cfg['histpath'] = os.path.expanduser(config.get('system', 'histpath'))
cfg['guistyle'] = config.get('system', 'guistyle')
cfg['mouseptr'] = config.getboolean('system', 'mouseptr')
print("Setting GUI style to '{}'".format(cfg['guistyle']))
cfg['gps'] = config.getboolean('gps', 'enabled')