Linux Display - create native Display window at the correct position on linux.

This commit is contained in:
kappa1 2011-08-29 21:31:23 +00:00
parent 702777d0fb
commit 910158d4c5
2 changed files with 20 additions and 16 deletions

View File

@ -334,15 +334,17 @@ static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_m
// Use Motif decoration hint property and hope the window manager respects them // Use Motif decoration hint property and hope the window manager respects them
setDecorations(disp, win, 0); setDecorations(disp, win, 0);
} }
XSizeHints * size_hints = XAllocSizeHints(); XSizeHints * window_hints = XAllocSizeHints();
size_hints->flags = PMinSize | PMaxSize; window_hints->flags = PPosition | PMinSize | PMaxSize;
size_hints->min_width = width; window_hints->x = x;
size_hints->max_width = width; window_hints->y = y;
size_hints->min_height = height; window_hints->min_width = width;
size_hints->max_height = height; window_hints->max_width = width;
XSetWMNormalHints(disp, win, size_hints); window_hints->min_height = height;
window_hints->max_height = height;
XSetWMNormalHints(disp, win, window_hints);
updateWindowHints(env, disp, win); updateWindowHints(env, disp, win);
XFree(size_hints); XFree(window_hints);
#define NUM_ATOMS 1 #define NUM_ATOMS 1
Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/}; Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS); XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);

View File

@ -328,15 +328,17 @@ static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_m
// Use Motif decoration hint property and hope the window manager respects them // Use Motif decoration hint property and hope the window manager respects them
setDecorations(disp, win, 0); setDecorations(disp, win, 0);
} }
XSizeHints * size_hints = XAllocSizeHints(); XSizeHints * window_hints = XAllocSizeHints();
size_hints->flags = PMinSize | PMaxSize; window_hints->flags = PPosition | PMinSize | PMaxSize;
size_hints->min_width = width; window_hints->x = x;
size_hints->max_width = width; window_hints->y = y;
size_hints->min_height = height; window_hints->min_width = width;
size_hints->max_height = height; window_hints->max_width = width;
XSetWMNormalHints(disp, win, size_hints); window_hints->min_height = height;
window_hints->max_height = height;
XSetWMNormalHints(disp, win, window_hints);
updateWindowHints(env, disp, win); updateWindowHints(env, disp, win);
XFree(size_hints); XFree(window_hints);
#define NUM_ATOMS 1 #define NUM_ATOMS 1
Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/}; Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS); XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);