@@ -51,6 +51,7 @@ xcb_window_t VideoWindow = 0;
5151xcb_pixmap_t pixmap = XCB_NONE ;
5252xcb_cursor_t cursor = XCB_NONE ;
5353int is_softhddevice = 0 ;
54+ int VideoFullscreen = 0 ;
5455
5556#ifdef __cplusplus
5657extern "C"
@@ -439,6 +440,10 @@ void cMpvPlayer::PlayerGetWindow(string need, xcb_connection_t **connect, xcb_wi
439440 //get geometry
440441 xcb_get_geometry_cookie_t geocookie ;
441442 xcb_get_geometry_reply_t * georeply ;
443+ xcb_get_property_cookie_t procookie ;
444+ xcb_get_property_reply_t * proreply ;
445+ xcb_intern_atom_reply_t * areply ;
446+ xcb_atom_t NetWmState ;
442447
443448 geocookie = xcb_get_geometry (* connect , window );
444449 georeply = xcb_get_geometry_reply (* connect , geocookie , NULL );
@@ -449,6 +454,28 @@ void cMpvPlayer::PlayerGetWindow(string need, xcb_connection_t **connect, xcb_wi
449454 y = georeply -> y ;
450455 free (georeply );
451456 }
457+ areply = xcb_intern_atom_reply (* connect , xcb_intern_atom (* connect , 0 , sizeof ("_NET_WM_STATE" ) - 1 , "_NET_WM_STATE" ), NULL );
458+ if (areply ) {
459+ NetWmState = areply -> atom ;
460+ free (areply );
461+
462+ procookie = xcb_get_property (* connect , 0 , window , NetWmState , XCB_ATOM_ATOM , 0 , sizeof (xcb_atom_t ));
463+ proreply = xcb_get_property_reply (* connect , procookie , NULL );
464+ if (proreply ) {
465+ xcb_atom_t NetWmStateFullscreen ;
466+ areply = xcb_intern_atom_reply (* connect , xcb_intern_atom (* connect , 0 , sizeof ("_NET_WM_STATE_FULLSCREEN" ) - 1 , "_NET_WM_STATE_FULLSCREEN" ), NULL );
467+ if (areply ) {
468+ NetWmStateFullscreen = areply -> atom ;
469+ free (areply );
470+
471+ if (((xcb_atom_t * )xcb_get_property_value (proreply ))[0 ] == NetWmStateFullscreen )
472+ VideoFullscreen = 1 ;
473+ else
474+ VideoFullscreen = 0 ;
475+ free (proreply );
476+ }
477+ }
478+ }
452479 }
453480
454481 if (parent ) {
@@ -602,7 +629,7 @@ void cMpvPlayer::PlayerStart()
602629 sprintf (geo , "%dx%d+%d+%d" , windowWidth , windowHeight , windowX , windowY );
603630 check_error (mpv_set_option_string (hMpv , "geometry" , geo ));
604631 }
605- if (!MpvPluginConfig -> Windowed )
632+ if (!MpvPluginConfig -> Windowed || VideoFullscreen )
606633 {
607634 check_error (mpv_set_option_string (hMpv , "fullscreen" , "yes" ));
608635 }
0 commit comments