@@ -289,7 +289,7 @@ void apply(void) {
289
289
slist_free (& heads_changing );
290
290
}
291
291
292
- bool handle_success (void ) {
292
+ void handle_success (void ) {
293
293
if (head_changing_mode ) {
294
294
295
295
// succesful mode change is not always reported
@@ -299,20 +299,21 @@ bool handle_success(void) {
299
299
300
300
} else if (head_changing_adaptive_sync ) {
301
301
302
- // adaptive sync changes are not reported as failures, but never try again
302
+ // sway reports adaptive sync failure as success
303
303
if (head_current_adaptive_sync_not_desired (head_changing_adaptive_sync )) {
304
304
log_info ("\n%s: Cannot enable VRR, display or compositor may not support it." , head_changing_adaptive_sync -> name );
305
305
head_changing_adaptive_sync -> adaptive_sync_failed = true;
306
- return false ;
306
+ return ;
307
307
}
308
308
}
309
309
310
- return true ;
310
+ log_info ( "\nChanges successful" ) ;
311
311
}
312
312
313
313
void handle_failure (void ) {
314
314
315
315
if (head_changing_mode ) {
316
+ log_error ("\nChanges failed" );
316
317
317
318
// mode setting failure, try again
318
319
log_error (" %s:" , head_changing_mode -> name );
@@ -323,7 +324,15 @@ void handle_failure(void) {
323
324
head_changing_mode -> current .mode = NULL ;
324
325
325
326
head_changing_mode = NULL ;
327
+
328
+ } else if (head_changing_adaptive_sync && head_current_adaptive_sync_not_desired (head_changing_adaptive_sync )) {
329
+
330
+ // river reports adaptive sync failure as failure
331
+ log_info ("\n%s: Cannot enable VRR, display or compositor may not support it." , head_changing_adaptive_sync -> name );
332
+ head_changing_adaptive_sync -> adaptive_sync_failed = true;
333
+
326
334
} else {
335
+ log_error ("\nChanges failed" );
327
336
328
337
// any other failures are fatal
329
338
exit_fail ();
@@ -340,9 +349,7 @@ void layout(void) {
340
349
341
350
switch (displ -> config_state ) {
342
351
case SUCCEEDED :
343
- if (handle_success ()) {
344
- log_info ("\nChanges successful" );
345
- }
352
+ handle_success ();
346
353
displ -> config_state = IDLE ;
347
354
break ;
348
355
@@ -351,7 +358,6 @@ void layout(void) {
351
358
return ;
352
359
353
360
case FAILED :
354
- log_error ("\nChanges failed" );
355
361
handle_failure ();
356
362
displ -> config_state = IDLE ;
357
363
break ;
0 commit comments