Skip to content
Snippets Groups Projects
Commit 108dd1be authored by deuce's avatar deuce
Browse files

Explicitly request keyboard focus. This fixes problems with Maemo5 on a

Nokia N900.

Debugged and initial patch by Aapo Rantalainen (Thanks!)
parent e84fad03
Branches
Tags
No related merge requests found
...@@ -324,6 +324,14 @@ int x_init(void) ...@@ -324,6 +324,14 @@ int x_init(void)
xp_dlclose(dl); xp_dlclose(dl);
return(-1); return(-1);
} }
if((x11.XAllocWMHints=xp_dlsym(dl,XAllocWMHints))==NULL) {
xp_dlclose(dl);
return(-1);
}
if((x11.XSetWMProperties=xp_dlsym(dl,XSetWMProperties))==NULL) {
xp_dlclose(dl);
return(-1);
}
if(sem_init(&pastebuf_set, 0, 0)) if(sem_init(&pastebuf_set, 0, 0))
return(-1); return(-1);
......
...@@ -195,6 +195,7 @@ static int init_window() ...@@ -195,6 +195,7 @@ static int init_window()
XColor color; XColor color;
int i; int i;
XWindowAttributes attr; XWindowAttributes attr;
XWMHints *wmhints;
dpy = x11.XOpenDisplay(NULL); dpy = x11.XOpenDisplay(NULL);
if (dpy == NULL) { if (dpy == NULL) {
...@@ -210,6 +211,14 @@ static int init_window() ...@@ -210,6 +211,14 @@ static int init_window()
win = x11.XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, win = x11.XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0,
1, 1, 2, black, black); 1, 1, 2, black, black);
wmhints=x11.XAllocWMHints();
if(wmhints) {
wmhints->initial_state=NormalState;
wmhints->flags = (StateHint | IconPixmapHint | IconMaskHint | InputHint);
wmhints->input = True;
x11.XSetWMProperties(dpy, win, NULL, NULL, 0, 0, NULL, wmhints, NULL);
}
gcv.function = GXcopy; gcv.function = GXcopy;
gcv.foreground = white; gcv.foreground = white;
gcv.background = black; gcv.background = black;
......
...@@ -78,6 +78,8 @@ struct x11 { ...@@ -78,6 +78,8 @@ struct x11 {
int (*XSetIconName) (Display*, Window, _Xconst char *); int (*XSetIconName) (Display*, Window, _Xconst char *);
int (*XSynchronize) (Display*, Bool); int (*XSynchronize) (Display*, Bool);
Status (*XGetWindowAttributes) (Display*,Window,XWindowAttributes*); Status (*XGetWindowAttributes) (Display*,Window,XWindowAttributes*);
XWMHints* (*XAllocWMHints) (void);
void (*XSetWMProperties) (Display*, Window, XTextProperty*, XTextProperty*, char**, int, XSizeHints*, XWMHints*, XClassHint*);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment