forked from LeenkxTeam/LNXRNT
Here comes he RunT!
This commit is contained in:
@ -29,6 +29,7 @@ struct linux_procs {
|
||||
int (*window_display)(int window_index);
|
||||
void (*window_show)(int window_index);
|
||||
void (*window_hide)(int window_index);
|
||||
void (*window_set_foreground)(int window_index);
|
||||
void (*window_set_title)(int window_index, const char *title);
|
||||
void (*window_change_mode)(int window_index, kinc_window_mode_t mode);
|
||||
kinc_window_mode_t (*window_get_mode)(int window_index);
|
||||
|
||||
@ -59,6 +59,7 @@ void kinc_linux_init_procs() {
|
||||
procs.window_resize = kinc_wayland_window_resize;
|
||||
procs.window_show = kinc_wayland_window_show;
|
||||
procs.window_hide = kinc_wayland_window_hide;
|
||||
procs.window_set_foreground = kinc_wayland_window_set_foreground;
|
||||
procs.count_windows = kinc_wayland_count_windows;
|
||||
|
||||
procs.mouse_can_lock = kinc_wl_mouse_can_lock;
|
||||
@ -111,6 +112,8 @@ void kinc_linux_init_procs() {
|
||||
procs.window_resize = kinc_x11_window_resize;
|
||||
procs.window_show = kinc_x11_window_show;
|
||||
procs.window_hide = kinc_x11_window_hide;
|
||||
procs.window_set_foreground = kinc_x11_window_set_foreground;
|
||||
|
||||
procs.count_windows = kinc_x11_count_windows;
|
||||
|
||||
procs.display_init = kinc_x11_display_init;
|
||||
|
||||
@ -80,6 +80,10 @@ void kinc_window_hide(int window_index) {
|
||||
procs.window_hide(window_index);
|
||||
}
|
||||
|
||||
void kinc_window_set_foreground(int window_index) {
|
||||
procs.window_set_foreground(window_index);
|
||||
}
|
||||
|
||||
void kinc_window_set_title(int window_index, const char *title) {
|
||||
procs.window_set_title(window_index, title);
|
||||
}
|
||||
|
||||
@ -145,6 +145,16 @@ void kinc_x11_window_hide(int window_index) {
|
||||
xlib.XUnmapWindow(x11_ctx.display, window->window);
|
||||
}
|
||||
|
||||
void kinc_x11_window_set_foreground(int window_index) {
|
||||
struct kinc_x11_window *window = &x11_ctx.windows[window_index];
|
||||
if (window->window == None) {
|
||||
return;
|
||||
}
|
||||
xlib.XRaiseWindow(x11_ctx.display, window->window);
|
||||
xlib.XSetInputFocus(x11_ctx.display, window->window, RevertToParent, CurrentTime);
|
||||
xlib.XFlush(x11_ctx.display);
|
||||
}
|
||||
|
||||
kinc_window_mode_t kinc_x11_window_get_mode(int window_index) {
|
||||
return x11_ctx.windows[window_index].mode;
|
||||
}
|
||||
|
||||
@ -392,6 +392,11 @@ void kinc_window_hide(int window_index) {
|
||||
UpdateWindow(windows[window_index].handle);
|
||||
}
|
||||
|
||||
void kinc_window_set_foreground(int window_index) {
|
||||
SetForegroundWindow(windows[window_index].handle);
|
||||
SetFocus(windows[window_index].handle);
|
||||
}
|
||||
|
||||
void kinc_window_set_title(int window_index, const char *title) {
|
||||
wchar_t buffer[1024];
|
||||
MultiByteToWideChar(CP_UTF8, 0, title, -1, buffer, 1024);
|
||||
|
||||
@ -139,6 +139,11 @@ KINC_FUNC void kinc_window_show(int window);
|
||||
/// </summary>
|
||||
KINC_FUNC void kinc_window_hide(int window);
|
||||
|
||||
/// <summary>
|
||||
/// Set a window to the foreground.
|
||||
/// </summary>
|
||||
KINC_FUNC void kinc_window_set_foreground(int window);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the title of a window.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user