* multi_screen testing + bugfixes
* ALT-TAB is working * tested on Ubuntu 14.10 Unity + LXDE * minor cleanup
This commit is contained in:
parent
dee27ce991
commit
dfb5a1d5e1
@ -8,3 +8,5 @@ icon="icon.png"
|
|||||||
|
|
||||||
fullscreen=false
|
fullscreen=false
|
||||||
resizable=true
|
resizable=true
|
||||||
|
width=800
|
||||||
|
height=600
|
||||||
|
Binary file not shown.
@ -42,7 +42,6 @@
|
|||||||
// ICCCM
|
// ICCCM
|
||||||
#define WM_NormalState 1L // window normal state
|
#define WM_NormalState 1L // window normal state
|
||||||
#define WM_IconicState 3L // window minimized
|
#define WM_IconicState 3L // window minimized
|
||||||
|
|
||||||
// EWMH
|
// EWMH
|
||||||
#define _NET_WM_STATE_REMOVE 0L // remove/unset property
|
#define _NET_WM_STATE_REMOVE 0L // remove/unset property
|
||||||
#define _NET_WM_STATE_ADD 1L // add/set property
|
#define _NET_WM_STATE_ADD 1L // add/set property
|
||||||
@ -192,9 +191,9 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
|
|||||||
visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
|
visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef EXPERIMENTAL_WM_API
|
||||||
// borderless fullscreen window mode
|
// borderless fullscreen window mode
|
||||||
if (current_videomode.fullscreen) {
|
if (current_videomode.fullscreen) {
|
||||||
#ifndef EXPERIMENTAL_WM_API
|
|
||||||
// needed for lxde/openbox, possibly others
|
// needed for lxde/openbox, possibly others
|
||||||
Hints hints;
|
Hints hints;
|
||||||
Atom property;
|
Atom property;
|
||||||
@ -222,16 +221,6 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
|
|||||||
xev.xclient.data.l[2] = 0;
|
xev.xclient.data.l[2] = 0;
|
||||||
|
|
||||||
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
|
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
|
||||||
#else
|
|
||||||
minimized = false;
|
|
||||||
minimized = false;
|
|
||||||
window_data.position.x = 0;
|
|
||||||
window_data.position.y = 0;
|
|
||||||
window_data.size.width = 800;
|
|
||||||
window_data.size.height = 600;
|
|
||||||
//set_wm_border(false);
|
|
||||||
set_wm_fullscreen(true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable resizable window
|
// disable resizable window
|
||||||
@ -252,6 +241,21 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
|
|||||||
XSetWMNormalHints(x11_display, x11_window, xsh);
|
XSetWMNormalHints(x11_display, x11_window, xsh);
|
||||||
XFree(xsh);
|
XFree(xsh);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (current_videomode.fullscreen) {
|
||||||
|
minimized = false;
|
||||||
|
maximized = false;
|
||||||
|
//set_wm_border(false);
|
||||||
|
set_wm_fullscreen(true);
|
||||||
|
}
|
||||||
|
if (!current_videomode.resizable) {
|
||||||
|
int screen = get_screen();
|
||||||
|
Size2i screen_size = get_screen_size(screen);
|
||||||
|
set_window_size(screen_size);
|
||||||
|
set_resizable(false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton();
|
AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton();
|
||||||
|
|
||||||
@ -519,7 +523,6 @@ OS::MouseMode OS_X11::get_mouse_mode() const {
|
|||||||
|
|
||||||
|
|
||||||
int OS_X11::get_mouse_button_state() const {
|
int OS_X11::get_mouse_button_state() const {
|
||||||
|
|
||||||
return last_button_state;
|
return last_button_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,6 +550,8 @@ void OS_X11::get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WM_API
|
#ifdef EXPERIMENTAL_WM_API
|
||||||
|
#if 0
|
||||||
|
// Just now not needed. Can be used for a possible OS.set_border(bool) method
|
||||||
void OS_X11::set_wm_border(bool p_enabled) {
|
void OS_X11::set_wm_border(bool p_enabled) {
|
||||||
// needed for lxde/openbox, possibly others
|
// needed for lxde/openbox, possibly others
|
||||||
Hints hints;
|
Hints hints;
|
||||||
@ -558,6 +563,7 @@ void OS_X11::set_wm_border(bool p_enabled) {
|
|||||||
XMapRaised(x11_display, x11_window);
|
XMapRaised(x11_display, x11_window);
|
||||||
//XMoveResizeWindow(x11_display, x11_window, 0, 0, 800, 800);
|
//XMoveResizeWindow(x11_display, x11_window, 0, 0, 800, 800);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void OS_X11::set_wm_fullscreen(bool p_enabled) {
|
void OS_X11::set_wm_fullscreen(bool p_enabled) {
|
||||||
// Using EWMH -- Extened Window Manager Hints
|
// Using EWMH -- Extened Window Manager Hints
|
||||||
@ -657,7 +663,11 @@ Point2 OS_X11::get_window_position() const {
|
|||||||
int x,y;
|
int x,y;
|
||||||
Window child;
|
Window child;
|
||||||
XTranslateCoordinates( x11_display, x11_window, DefaultRootWindow(x11_display), 0, 0, &x, &y, &child);
|
XTranslateCoordinates( x11_display, x11_window, DefaultRootWindow(x11_display), 0, 0, &x, &y, &child);
|
||||||
return Point2i(x,y);
|
|
||||||
|
int screen = get_screen();
|
||||||
|
Point2i screen_position = get_screen_position(screen);
|
||||||
|
|
||||||
|
return Point2i(x-screen_position.x, y-screen_position.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_X11::set_window_position(const Point2& p_position) {
|
void OS_X11::set_window_position(const Point2& p_position) {
|
||||||
@ -698,6 +708,12 @@ void OS_X11::set_window_position(const Point2& p_position) {
|
|||||||
XFree(data);
|
XFree(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int screen = get_screen();
|
||||||
|
Point2i screen_position = get_screen_position(screen);
|
||||||
|
|
||||||
|
left -= screen_position.x;
|
||||||
|
top -= screen_position.y;
|
||||||
|
|
||||||
XMoveWindow(x11_display,x11_window,p_position.x - left,p_position.y - top);
|
XMoveWindow(x11_display,x11_window,p_position.x - left,p_position.y - top);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1146,9 +1162,9 @@ void OS_X11::process_xevents() {
|
|||||||
minimized = (visibility->state == VisibilityFullyObscured);
|
minimized = (visibility->state == VisibilityFullyObscured);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
|
minimized = false;
|
||||||
if(current_videomode.fullscreen) {
|
if(current_videomode.fullscreen) {
|
||||||
set_minimized(false);
|
|
||||||
set_wm_fullscreen(true);
|
set_wm_fullscreen(true);
|
||||||
visual_server->init();
|
visual_server->init();
|
||||||
}
|
}
|
||||||
|
@ -160,16 +160,8 @@ class OS_X11 : public OS_Unix {
|
|||||||
Joystick joysticks[JOYSTICKS_MAX];
|
Joystick joysticks[JOYSTICKS_MAX];
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WM_API
|
#ifdef EXPERIMENTAL_WM_API
|
||||||
// This struct saves the values of the window before going fullscreen
|
|
||||||
// to be able to restore the same state after leaving fullscreen
|
|
||||||
struct {
|
|
||||||
bool resizable;
|
|
||||||
Point2i position;
|
|
||||||
Size2i size;
|
|
||||||
} window_data;
|
|
||||||
|
|
||||||
bool maximized;
|
bool maximized;
|
||||||
void set_wm_border(bool p_enabled);
|
//void set_wm_border(bool p_enabled);
|
||||||
void set_wm_fullscreen(bool p_enabled);
|
void set_wm_fullscreen(bool p_enabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user