Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/backend/DeckManagement/DeckController.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ def set_action_label(self, position: str, label: "KeyLabel", update: bool = True
else:
self.action_labels[position] = label

self.update_label_editor()
GLib.idle_add(self.update_label_editor)
if update:
self.update_label(position)

Expand Down Expand Up @@ -1471,7 +1471,7 @@ def set_action_layout(self, layout: ImageLayout, update: bool = True):

def update(self):
self.controller_input.update()
self.update_layout_editor()
GLib.idle_add(self.update_layout_editor)

def update_layout_editor(self):
if not recursive_hasattr(gl, "app.main_win.leftArea.deck_stack"):
Expand Down Expand Up @@ -1548,7 +1548,7 @@ def set_page_color(self, color: list[int], update: bool = True, update_ui: bool
def update(self, ui: bool = True):
self.controller_input.update()
if ui:
self.update_background_editor()
GLib.idle_add(self.update_background_editor)

def update_background_editor(self):
if not recursive_hasattr(gl, "app.main_win.leftArea.deck_stack"):
Expand Down Expand Up @@ -2274,7 +2274,7 @@ def set_ui_key_image(self, image: Image.Image) -> None:
self.deck_controller.ui_image_changes_while_hidden[self.identifier] = image # The ui key coords are in reverse order
else:
try:
self.deck_controller.get_own_key_grid().buttons[x][y].set_image(image)
GLib.idle_add(self.deck_controller.get_own_key_grid().buttons[x][y].set_image, image)
except:
print(f"Failed to set ui key image for {self.identifier}")

Expand Down Expand Up @@ -2347,7 +2347,7 @@ def get_empty_dial_image(self) -> Image.Image:
def set_ui_image(self, image: Image.Image) -> None:
if recursive_hasattr(self, "deck_controller.own_deck_stack_child.page_settings.deck_config.screenbar.image") and gl.app.main_win.get_mapped():
screenbar = self.deck_controller.own_deck_stack_child.page_settings.deck_config.screenbar
screenbar.image.set_image(image)
GLib.idle_add(screenbar.image.set_image, image)
else:
self.deck_controller.ui_image_changes_while_hidden[self.identifier] = image

Expand Down
5 changes: 4 additions & 1 deletion src/backend/PluginManager/ActionCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from src.backend.PluginManager.EventAssigner import EventAssigner

gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
from gi.repository import Gtk, GLib

import rpyc
from rpyc.utils.server import ThreadedServer
Expand Down Expand Up @@ -505,6 +505,9 @@ def get_generative_ui_widgets(self):
return widgets

def load_initial_generative_ui(self):
GLib.idle_add(self._do_load_initial_generative_ui)

def _do_load_initial_generative_ui(self):
for generative_object in self.generative_ui_objects:
generative_object.load_initial_ui()

Expand Down
2 changes: 1 addition & 1 deletion src/windows/mainWindow/DeckPlus/ScreenBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def set_image(self, image: Image.Image):

dial_image = image.crop(dial_image_area)

gl.app.main_win.sidebar.key_editor.icon_selector.set_image(dial_image)
GLib.idle_add(gl.app.main_win.sidebar.key_editor.icon_selector.set_image, dial_image)

def set_pixbuf_and_del(self, pixbuf, task_id: int = None):
if task_id is not None:
Expand Down