|
Lines 14-19
Link Here
|
| 14 |
#include <unistd.h> |
14 |
#include <unistd.h> |
| 15 |
#include <sys/mman.h> |
15 |
#include <sys/mman.h> |
| 16 |
#include <signal.h> |
16 |
#include <signal.h> |
|
|
17 |
#include <assert.h> |
| 17 |
|
18 |
|
| 18 |
#include "video_out.h" |
19 |
#include "video_out.h" |
| 19 |
#include "aspect.h" |
20 |
#include "aspect.h" |
|
Lines 117-122
Link Here
|
| 117 |
|
118 |
|
| 118 |
static int vo_x11_get_fs_type(int supported); |
119 |
static int vo_x11_get_fs_type(int supported); |
| 119 |
|
120 |
|
|
|
121 |
/* |
| 122 |
* Sends the EWMH fullscreen state event. |
| 123 |
* |
| 124 |
* action: could be on of _NET_WM_STATE_REMOVE -- remove state |
| 125 |
* _NET_WM_STATE_ADD -- add state |
| 126 |
* _NET_WM_STATE_TOGGLE -- toggle |
| 127 |
*/ |
| 128 |
void vo_x11_ewmh_fullscreen( int action ) |
| 129 |
{ |
| 130 |
assert( action == _NET_WM_STATE_REMOVE || |
| 131 |
action == _NET_WM_STATE_ADD || |
| 132 |
action == _NET_WM_STATE_TOGGLE ); |
| 133 |
|
| 134 |
if ( vo_fs_type & vo_wm_FULLSCREEN ) |
| 135 |
{ |
| 136 |
XEvent xev; |
| 137 |
|
| 138 |
/* init X event structure for _NET_WM_FULLSCREEN client msg */ |
| 139 |
xev.xclient.type = ClientMessage; |
| 140 |
xev.xclient.serial = 0; |
| 141 |
xev.xclient.send_event = True; |
| 142 |
xev.xclient.message_type = XInternAtom( mDisplay, |
| 143 |
"_NET_WM_STATE", False ); |
| 144 |
xev.xclient.window = vo_window; |
| 145 |
xev.xclient.format = 32; |
| 146 |
xev.xclient.data.l[0] = action; |
| 147 |
xev.xclient.data.l[1] = XInternAtom( mDisplay, |
| 148 |
"_NET_WM_STATE_FULLSCREEN", False ); |
| 149 |
xev.xclient.data.l[2] = 0; |
| 150 |
xev.xclient.data.l[3] = 0; |
| 151 |
xev.xclient.data.l[4] = 0; |
| 152 |
|
| 153 |
/* finally send that damn thing */ |
| 154 |
if ( !XSendEvent( mDisplay, DefaultRootWindow( mDisplay ), False, |
| 155 |
SubstructureRedirectMask | SubstructureNotifyMask, &xev ) ) |
| 156 |
{ |
| 157 |
mp_msg( MSGT_VO,MSGL_ERR, MSGTR_EwmhFullscreenStateFailed ); |
| 158 |
} |
| 159 |
} |
| 160 |
} |
| 161 |
|
| 120 |
void vo_hidecursor ( Display *disp , Window win ) |
162 |
void vo_hidecursor ( Display *disp , Window win ) |
| 121 |
{ |
163 |
{ |
| 122 |
Cursor no_ptr; |
164 |
Cursor no_ptr; |
|
Lines 1062-1072
Link Here
|
| 1062 |
|
1104 |
|
| 1063 |
if ( vo_fs ){ |
1105 |
if ( vo_fs ){ |
| 1064 |
// fs->win |
1106 |
// fs->win |
|
|
1107 |
vo_x11_ewmh_fullscreen( _NET_WM_STATE_REMOVE ); // removes fullscreen state if wm supports EWMH |
| 1108 |
|
| 1065 |
if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; |
1109 |
if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; |
| 1066 |
vo_fs=VO_FALSE; |
1110 |
vo_fs=VO_FALSE; |
| 1067 |
x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; |
1111 |
x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; |
| 1068 |
} else { |
1112 |
} else { |
| 1069 |
// win->fs |
1113 |
// win->fs |
|
|
1114 |
vo_x11_ewmh_fullscreen( _NET_WM_STATE_ADD ); // sends fullscreen state to be added if wm supports EWMH |
| 1070 |
if(vo_old_width && |
1115 |
if(vo_old_width && |
| 1071 |
(vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) && |
1116 |
(vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) && |
| 1072 |
(vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; |
1117 |
(vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; |