Skip to content
Snippets Groups Projects
Commit e1a6e1ac authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Attempt to set resource name/class correctly for XIM

parent fc29b7c7
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4462 passed
...@@ -824,6 +824,7 @@ static void map_window() ...@@ -824,6 +824,7 @@ static void map_window()
sh->min_aspect.x = sh->max_aspect.x = sh->min_width; sh->min_aspect.x = sh->max_aspect.x = sh->min_width;
sh->min_aspect.y = sh->max_aspect.y = sh->min_height; sh->min_aspect.y = sh->max_aspect.y = sh->min_height;
} }
sh->flags |= PAspect; sh->flags |= PAspect;
x11.XSetWMNormalHints(dpy, win, sh); x11.XSetWMNormalHints(dpy, win, sh);
...@@ -1025,9 +1026,10 @@ static int init_window() ...@@ -1025,9 +1026,10 @@ static int init_window()
if(wmhints) { if(wmhints) {
wmhints->flags = 0; wmhints->flags = 0;
wmhints->initial_state=NormalState; wmhints->initial_state=NormalState;
wmhints->flags |= (StateHint | InputHint);
wmhints->input = True; wmhints->input = True;
wmhints->flags |= (StateHint | InputHint);
set_icon(ciolib_initial_icon, ciolib_initial_icon_width, wmhints); set_icon(ciolib_initial_icon, ciolib_initial_icon_width, wmhints);
// TODO: We could get the window/icon name right at the start...
x11.XSetWMProperties(dpy, win, NULL, NULL, 0, 0, NULL, wmhints, classhints); x11.XSetWMProperties(dpy, win, NULL, NULL, 0, 0, NULL, wmhints, classhints);
x11.XFree(wmhints); x11.XFree(wmhints);
} }
...@@ -1052,7 +1054,7 @@ static int init_window() ...@@ -1052,7 +1054,7 @@ static int init_window()
if (a != None) if (a != None)
set_win_property(ATOM__NET_WM_STATE, XA_ATOM, 32, PropModeReplace, &a, 1); set_win_property(ATOM__NET_WM_STATE, XA_ATOM, 32, PropModeReplace, &a, 1);
im = x11.XOpenIM(dpy, NULL, "CIOLIB", "CIOLIB"); im = x11.XOpenIM(dpy, NULL, classhints ? classhints->res_name : "CIOLIB", classhints ? classhints->res_class : "CIOLIB");
if (im != NULL) { if (im != NULL) {
ic = x11.XCreateIC(im, XNClientWindow, win, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, NULL); ic = x11.XCreateIC(im, XNClientWindow, win, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, NULL);
if (ic) if (ic)
...@@ -1169,9 +1171,8 @@ static void resize_window() ...@@ -1169,9 +1171,8 @@ static void resize_window()
} }
resize = new_scaling != vstat.scaling; resize = new_scaling != vstat.scaling;
x_cvstat.scaling = vstat.scaling; x_cvstat.scaling = vstat.scaling;
if (resize) { if (resize)
x11.XResizeWindow(dpy, win, width, height); x11.XResizeWindow(dpy, win, width, height);
}
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
return; return;
...@@ -1653,13 +1654,12 @@ static int x11_event(XEvent *ev) ...@@ -1653,13 +1654,12 @@ static int x11_event(XEvent *ev)
x_cvstat.winheight = h; x_cvstat.winheight = h;
if (resize) if (resize)
x11.XMoveResizeWindow(dpy, win, saved_xpos, saved_ypos, w, h); x11.XMoveResizeWindow(dpy, win, saved_xpos, saved_ypos, w, h);
else { else
x11.XMoveWindow(dpy, win, saved_xpos, saved_ypos); x11.XMoveWindow(dpy, win, saved_xpos, saved_ypos);
} }
} }
} }
} }
}
break; break;
/* Graphics related events */ /* Graphics related events */
case ConfigureNotify: { case ConfigureNotify: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment