def __init__(self, preserve_viewid=None, stop_flag=None): if stop_flag is None: stop_flag = Event() self.stop_flag = stop_flag if preserve_viewid is None: window = xbmcgui.Window(xbmcgui.getCurrentWindowId()) preserve_viewid = window.getFocusId() self.preserve_viewid = preserve_viewid self.keyboardMonitor = KeyboardMonitor() self.keyboardMonitor.start()
def fix_xbmc_music_library_view(): # avoid context menu replacing bug by # switching window from musiclibrary to musicfiles if xbmcgui.getCurrentWindowId() == 10502: url = plugin.url_for(endpoint='show_root_menu') xbmc.executebuiltin('ReplaceWindow(MusicFiles, %s)' % url)