@@ -249,14 +249,6 @@ static bool xdpy_create_display_window(ALLEGRO_SYSTEM_XGLX *system,
249
249
}
250
250
}
251
251
252
- if (display -> flags & ALLEGRO_FRAMELESS ) {
253
- _al_xwin_set_frame (display , false);
254
- }
255
-
256
- if (display -> flags & ALLEGRO_DRAG_AND_DROP ) {
257
- _al_xwin_accept_drag_and_drop (display , true);
258
- }
259
-
260
252
ALLEGRO_DEBUG ("X11 window created.\n" );
261
253
262
254
/* Set the PID related to the window. */
@@ -463,11 +455,26 @@ static ALLEGRO_DISPLAY_XGLX *xdpy_create_display_locked(
463
455
}
464
456
}
465
457
458
+ if (display -> flags & ALLEGRO_FRAMELESS ) {
459
+ /* set_display_flag works by comparing to current flag value, so we need
460
+ * to start with an unset state. */
461
+ display -> flags &= ~ALLEGRO_FRAMELESS ;
462
+ /* Call the vt directly to bypass system lock.
463
+ */
464
+ d -> overridable_vt -> set_display_flag (display , ALLEGRO_FRAMELESS , true);
465
+ }
466
+
467
+ if (display -> flags & ALLEGRO_DRAG_AND_DROP ) {
468
+ _al_xwin_accept_drag_and_drop (display , true);
469
+ }
470
+
466
471
if (flags & ALLEGRO_MAXIMIZED ) {
467
- /* _al_xwin_maximize works by comparing to current flag value, so we need
468
- * to start with an unmaximized state. */
472
+ /* set_display_flag works by comparing to current flag value, so we need
473
+ * to start with an unset state. */
469
474
display -> flags &= ~ALLEGRO_MAXIMIZED ;
470
- _al_xwin_maximize (display , true);
475
+ /* Call the vt directly to bypass system lock.
476
+ */
477
+ d -> overridable_vt -> set_display_flag (display , ALLEGRO_MAXIMIZED , true);
471
478
}
472
479
473
480
if (!_al_xglx_config_create_context (d )) {
@@ -890,7 +897,7 @@ static bool xdpy_acknowledge_resize(ALLEGRO_DISPLAY *d)
890
897
_al_ogl_setup_gl (d );
891
898
}
892
899
893
- _al_xwin_check_maximized (d );
900
+ glx -> overridable_vt -> check_maximized (d );
894
901
}
895
902
896
903
_al_mutex_unlock (& system -> lock );
@@ -1081,7 +1088,7 @@ void _al_xglx_display_configure(ALLEGRO_DISPLAY *d, int x, int y,
1081
1088
1082
1089
}
1083
1090
1084
- _al_xwin_check_maximized (d );
1091
+ glx -> overridable_vt -> check_maximized (d );
1085
1092
1086
1093
_al_event_source_unlock (es );
1087
1094
}
@@ -1329,9 +1336,7 @@ static void xdpy_apply_window_constraints(ALLEGRO_DISPLAY *display,
1329
1336
1330
1337
static void xdpy_set_fullscreen_window_default (ALLEGRO_DISPLAY * display , bool onoff )
1331
1338
{
1332
- ALLEGRO_SYSTEM_XGLX * system = (void * )al_get_system_driver ();
1333
1339
if (onoff == !(display -> flags & ALLEGRO_FULLSCREEN_WINDOW )) {
1334
- _al_mutex_lock (& system -> lock );
1335
1340
_al_xwin_reset_size_hints (display );
1336
1341
_al_xwin_set_fullscreen_window (display , 2 );
1337
1342
/* XXX Technically, the user may fiddle with the _NET_WM_STATE_FULLSCREEN
@@ -1342,19 +1347,11 @@ static void xdpy_set_fullscreen_window_default(ALLEGRO_DISPLAY *display, bool on
1342
1347
_al_xwin_set_size_hints (display , INT_MAX , INT_MAX );
1343
1348
1344
1349
set_compositor_bypass_flag (display );
1345
- _al_mutex_unlock (& system -> lock );
1346
1350
}
1347
1351
}
1348
1352
1349
1353
1350
- static void xdpy_set_fullscreen_window (ALLEGRO_DISPLAY * display , bool onoff )
1351
- {
1352
- ALLEGRO_DISPLAY_XGLX * glx = (ALLEGRO_DISPLAY_XGLX * )display ;
1353
- glx -> overridable_vt -> set_fullscreen_window (display , onoff );
1354
- }
1355
-
1356
-
1357
- static bool xdpy_set_display_flag (ALLEGRO_DISPLAY * display , int flag ,
1354
+ static bool xdpy_set_display_flag_default (ALLEGRO_DISPLAY * display , int flag ,
1358
1355
bool flag_onoff )
1359
1356
{
1360
1357
switch (flag ) {
@@ -1363,7 +1360,9 @@ static bool xdpy_set_display_flag(ALLEGRO_DISPLAY *display, int flag,
1363
1360
_al_xwin_set_frame (display , !flag_onoff );
1364
1361
return true;
1365
1362
case ALLEGRO_FULLSCREEN_WINDOW :
1366
- xdpy_set_fullscreen_window (display , flag_onoff );
1363
+ /* Bypass system lock. */
1364
+ ALLEGRO_DISPLAY_XGLX * glx = (ALLEGRO_DISPLAY_XGLX * )display ;
1365
+ glx -> overridable_vt -> set_fullscreen_window (display , flag_onoff );
1367
1366
return true;
1368
1367
case ALLEGRO_MAXIMIZED :
1369
1368
_al_xwin_maximize (display , flag_onoff );
@@ -1373,6 +1372,17 @@ static bool xdpy_set_display_flag(ALLEGRO_DISPLAY *display, int flag,
1373
1372
}
1374
1373
1375
1374
1375
+ static bool xdpy_set_display_flag (ALLEGRO_DISPLAY * display , int flag , bool onoff )
1376
+ {
1377
+ ALLEGRO_DISPLAY_XGLX * glx = (ALLEGRO_DISPLAY_XGLX * )display ;
1378
+ ALLEGRO_SYSTEM_XGLX * system = (ALLEGRO_SYSTEM_XGLX * )al_get_system_driver ();
1379
+ _al_mutex_lock (& system -> lock );
1380
+ bool ret = glx -> overridable_vt -> set_display_flag (display , flag , onoff );
1381
+ _al_mutex_unlock (& system -> lock );
1382
+ return ret ;
1383
+ }
1384
+
1385
+
1376
1386
static bool xdpy_wait_for_vsync (ALLEGRO_DISPLAY * display )
1377
1387
{
1378
1388
(void ) display ;
@@ -1433,7 +1443,9 @@ static const ALLEGRO_XWIN_DISPLAY_OVERRIDABLE_INTERFACE default_overridable_vt =
1433
1443
xdpy_set_window_title_default ,
1434
1444
xdpy_set_fullscreen_window_default ,
1435
1445
xdpy_set_window_position_default ,
1436
- xdpy_set_window_constraints_default
1446
+ xdpy_set_window_constraints_default ,
1447
+ xdpy_set_display_flag_default ,
1448
+ _al_xwin_check_maximized ,
1437
1449
};
1438
1450
1439
1451
0 commit comments