Bugfix: Fix screen wrapping, cleanup some log messages
Before this fix, you could go upwards and select the screen which was at the rightmost because it also was the one topmost (if all screen’s top position is equal).
This commit is contained in:
@ -92,7 +92,7 @@ i3Screen *get_screen_containing(int x, int y) {
|
||||
* This function always returns a screen.
|
||||
*
|
||||
*/
|
||||
i3Screen *get_screen_most(direction_t direction) {
|
||||
i3Screen *get_screen_most(direction_t direction, i3Screen *current) {
|
||||
i3Screen *screen, *candidate = NULL;
|
||||
int position = 0;
|
||||
TAILQ_FOREACH(screen, virtual_screens, screens) {
|
||||
@ -104,6 +104,14 @@ i3Screen *get_screen_most(direction_t direction) {
|
||||
} \
|
||||
break;
|
||||
|
||||
if (((direction == D_UP) || (direction == D_DOWN)) &&
|
||||
(current->rect.x != screen->rect.x))
|
||||
continue;
|
||||
|
||||
if (((direction == D_LEFT) || (direction == D_RIGHT)) &&
|
||||
(current->rect.y != screen->rect.y))
|
||||
continue;
|
||||
|
||||
switch (direction) {
|
||||
case D_UP:
|
||||
WIN(screen->rect.y, <= position);
|
||||
|
Reference in New Issue
Block a user