Skip to content

Commit 98851a1

Browse files
committed
- Improved initialization and fixed a regression in 4K auto-detection on systemFirstLaunch introduced in commit 14ee427.
* Cleaned up the last callback (on_paint) and moved it to gr-callbacks.js
1 parent aafc3c0 commit 98851a1

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

profile/georgia-reborn/scripts/Base/gr-callbacks.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ function on_playback_new_track(metadb) {
111111
}
112112

113113

114+
/**
115+
* Called when drawing graphics.
116+
* Draws the main user interface.
117+
* @global
118+
* @param {GdiGraphics} gr - The GDI graphics object.
119+
*/
120+
function on_paint(gr) {
121+
grm.ui.drawMain(gr);
122+
}
123+
124+
114125
/**
115126
* Called when window is being resized.
116127
*

profile/georgia-reborn/scripts/Base/gr-initialize.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// * Website: https://github.com/TT-ReBORN/Georgia-ReBORN * //
77
// * Version: 3.0-RC3 * //
88
// * Dev. started: 22-12-2017 * //
9-
// * Last change: 27-10-2024 * //
9+
// * Last change: 17-01-2025 * //
1010
/////////////////////////////////////////////////////////////////////////////////
1111

1212

@@ -62,13 +62,3 @@ if (grSet.systemFirstLaunch) {
6262
grm.ui.initFonts();
6363
grm.ui.initMain();
6464
}
65-
66-
/**
67-
* Called when drawing graphics.
68-
* Draws the main user interface.
69-
* @global
70-
* @param {GdiGraphics} gr - The GDI graphics object.
71-
*/
72-
function on_paint(gr) {
73-
grm.ui.drawMain(gr);
74-
}

profile/georgia-reborn/scripts/Base/gr-main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,8 @@ class MainUI {
19351935
this.setMainComponents('all');
19361936

19371937
// * Init panels
1938+
// Wait for on_size to be loaded in gr-callbacks.js after gr-initialize.js
1939+
await MakeAsync(() => {}, () => typeof on_size !== 'undefined');
19381940
await MakeAsync(() => PlaylistRescale(true));
19391941
await MakeAsync(() => this.initPlaylist());
19401942
await MakeAsync(() => this.initLibraryPanel());
@@ -1943,8 +1945,6 @@ class MainUI {
19431945

19441946
// * Init state
19451947
if (fb.IsPlaying && fb.GetNowPlaying()) {
1946-
// Wait for on_playback_new_track to be loaded in gr-callbacks.js
1947-
await MakeAsync(() => {}, () => typeof on_playback_new_track !== 'undefined');
19481948
on_playback_new_track(fb.GetNowPlaying());
19491949
}
19501950
plman.SetActivePlaylistContext();

0 commit comments

Comments
 (0)