diff --git a/src/tauon/__main__.py b/src/tauon/__main__.py index 774daa2a6..3227f4c7c 100755 --- a/src/tauon/__main__.py +++ b/src/tauon/__main__.py @@ -270,7 +270,8 @@ def transfer_args_and_exit() -> None: os.environ["SDL_VIDEODRIVER"] = "x11" -sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO) +sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO | sdl3.SDL_INIT_EVENTS) + err = sdl3.SDL_GetError() if err and "GLX" in err.decode(): logging.error(f"SDL init error: {err.decode()}") diff --git a/src/tauon/t_modules/t_main.py b/src/tauon/t_modules/t_main.py index d88ba97c5..6babc7692 100644 --- a/src/tauon/t_modules/t_main.py +++ b/src/tauon/t_modules/t_main.py @@ -63,7 +63,6 @@ import socket import subprocess import sys - import threading import time import urllib.parse @@ -688,7 +687,7 @@ def reload(self) -> None: def render(self, x: int, y: int, colour=None) -> None: self.rect.x = round(x) self.rect.y = round(y) - sdl3.SDL_RenderCopy(renderer, self.texture, None, self.rect) + sdl3.SDL_RenderTexture(renderer, self.texture, None, self.rect) class WhiteModImageAsset: @@ -41544,7 +41543,7 @@ def hit_callback(win, point, data): update_layout = True -event = sdl3.SDL_Event() + mouse_moved = False @@ -42711,6 +42710,9 @@ def drop_file(target): # MAIN LOOP +event = sdl3.SDL_Event() +event_ptr = ctypes.pointer(event) + while pctl.running: # bm.get('main') # time.sleep(100) @@ -43160,7 +43162,7 @@ def drop_file(target): i_x = pointer(c_int(0)) i_y = pointer(c_int(0)) - sdl3.SDL_GL_GetDrawableSize(t_window, i_x, i_y) + sdl3.SDL_GetWindowSizeInPixels(t_window, i_x, i_y) window_size[0] = i_x.contents.value window_size[1] = i_y.contents.value @@ -44173,8 +44175,8 @@ def drop_file(target): gui.showed_title = False if not gui.mouse_in_window and not bottom_bar1.volume_bar_being_dragged and not bottom_bar1.volume_hit and not bottom_bar1.seek_hit: - mouse_position[0] = -300 - mouse_position[1] = -300 + mouse_position[0] = -300. + mouse_position[1] = -300. if gui.clear_image_cache_next: gui.clear_image_cache_next -= 1 diff --git a/src/tauon/t_modules/t_themeload.py b/src/tauon/t_modules/t_themeload.py index 9596251b9..63730bb87 100644 --- a/src/tauon/t_modules/t_themeload.py +++ b/src/tauon/t_modules/t_themeload.py @@ -26,16 +26,6 @@ from typing import TYPE_CHECKING from PIL import Image -from sdl2 import ( - SDL_CreateTextureFromSurface, - SDL_DestroyTexture, - SDL_FreeSurface, - SDL_Rect, - SDL_RenderCopy, - SDL_SetTextureAlphaMod, - rw_from_object, -) -from sdl2.sdlimage import IMG_Load_RW from tauon.t_modules.t_extra import rgb_add_hls, test_lumi