@@ -630,73 +630,25 @@ static int layout_extents_max_x(struct greeter_server* server) {
630630
631631static bool layout_output_at (struct greeter_output * output , int layout_x , int layout_y );
632632
633- struct configured_layout_entry {
634- struct greeter_output * output ;
635- struct greeter_output_placement cfg ;
636- };
637-
638- static int compare_configured_layout_entry (const void * a , const void * b ) {
639- const struct configured_layout_entry * ea = a ;
640- const struct configured_layout_entry * eb = b ;
641- if (ea -> cfg .y != eb -> cfg .y ) {
642- return ea -> cfg .y - eb -> cfg .y ;
643- }
644- if (ea -> cfg .x != eb -> cfg .x ) {
645- return ea -> cfg .x - eb -> cfg .x ;
646- }
647- return strcmp (ea -> cfg .name , eb -> cfg .name );
648- }
649-
650633static void layout_outputs_from_config (struct greeter_server * server ) {
651- struct configured_layout_entry entries [16 ];
652- size_t count = 0 ;
653634 for (size_t i = 0 ; i < server -> output_placement_count ; ++ i ) {
654635 const struct greeter_output_placement * cfg = & server -> output_placements [i ];
655636 struct greeter_output * output = output_by_name (server , cfg -> name );
656637 if (output == NULL ) {
657638 wlr_log (WLR_INFO , "output_layout: '%s' not connected" , cfg -> name );
658639 continue ;
659640 }
660- entries [count ].output = output ;
661- entries [count ].cfg = * cfg ;
662- ++ count ;
663- }
664- if (count == 0 ) {
665- return ;
666- }
667-
668- qsort (entries , count , sizeof (entries [0 ]), compare_configured_layout_entry );
669-
670- int row_cfg_y = entries [0 ].cfg .y ;
671- int layout_x = 0 ;
672- int layout_y = 0 ;
673- int row_max_effective_height = 0 ;
674- for (size_t i = 0 ; i < count ; ++ i ) {
675- if (i > 0 && entries [i ].cfg .y != row_cfg_y ) {
676- layout_y += row_max_effective_height ;
677- layout_x = 0 ;
678- row_cfg_y = entries [i ].cfg .y ;
679- row_max_effective_height = 0 ;
680- }
681-
682- if (!layout_output_at (entries [i ].output , layout_x , layout_y )) {
641+ if (!layout_output_at (output , cfg -> x , cfg -> y )) {
683642 continue ;
684643 }
685644
686645 int effective_width = 0 ;
687646 int effective_height = 0 ;
688- wlr_output_effective_resolution (entries [ i ]. output -> wlr_output , & effective_width , & effective_height );
647+ wlr_output_effective_resolution (output -> wlr_output , & effective_width , & effective_height );
689648 wlr_log (
690- WLR_INFO , "greeter output: %s at (%d,%d) (configured %s:%d,%d; effective %dx%d)" , entries [ i ]. cfg . name , layout_x ,
691- layout_y , entries [ i ]. cfg . name , entries [ i ]. cfg . x , entries [ i ]. cfg . y , effective_width , effective_height
649+ WLR_INFO , "greeter output: %s at (%d,%d) (effective %dx%d)" , cfg -> name , cfg -> x , cfg -> y , effective_width ,
650+ effective_height
692651 );
693-
694- if (effective_height > row_max_effective_height ) {
695- row_max_effective_height = effective_height ;
696- }
697- if (effective_width > 0 ) {
698- layout_x += effective_width ;
699- }
700652 }
701653
702654 int fallback_x = layout_extents_max_x (server );
0 commit comments