summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-27 14:17:07 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-27 14:17:07 +0100
commita018f8273fed6549d2fc529e5bb58cba11869ffb (patch)
tree3496a3a84640c24e43b4dc92ba96d16e1aa03a1b /src
parent373b4c5ee14b87bbe548e69ad208a9a0806dd52f (diff)
e randr x - move pointer to a visible screen coord if outside screens
on reconfigure if we find the pointer outside the screen region bounds it can get caught there until a warp forces it in. this is due to the barriers i added i think. this fixes that @fix
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_comp_x_randr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bin/e_comp_x_randr.c b/src/bin/e_comp_x_randr.c
index 7754fd11e..da1b0759d 100644
--- a/src/bin/e_comp_x_randr.c
+++ b/src/bin/e_comp_x_randr.c
@@ -490,6 +490,8 @@ e_comp_x_randr_config_apply(void)
490 int crtcs_num = 0, outputs_num = 0, i, numout; 490 int crtcs_num = 0, outputs_num = 0, i, numout;
491 Ecore_X_Randr_Crtc_Info *info; 491 Ecore_X_Randr_Crtc_Info *info;
492 int top_priority = 0; 492 int top_priority = 0;
493 int px, py;
494 Eina_Bool fix_pointer = EINA_TRUE;
493 495
494 ecore_x_grab(); 496 ecore_x_grab();
495 // set virtual resolution 497 // set virtual resolution
@@ -509,6 +511,8 @@ e_comp_x_randr_config_apply(void)
509 if (nh < minh) nh = minh; 511 if (nh < minh) nh = minh;
510 ww = nw; if (nw < pw) ww = pw; 512 ww = nw; if (nw < pw) ww = pw;
511 hh = nh; if (nh < ph) hh = ph; 513 hh = nh; if (nh < ph) hh = ph;
514
515 ecore_x_pointer_xy_get(root, &px, &py);
512 ecore_x_randr_screen_current_size_set(root, ww, hh, -1, -1); 516 ecore_x_randr_screen_current_size_set(root, ww, hh, -1, -1);
513 { 517 {
514 int dww = 0, dhh = 0, dww2 = 0, dhh2 = 0; 518 int dww = 0, dhh = 0, dww2 = 0, dhh2 = 0;
@@ -610,6 +614,16 @@ e_comp_x_randr_config_apply(void)
610 screenconf[i]->config.geom.y, 614 screenconf[i]->config.geom.y,
611 mode, orient)) 615 mode, orient))
612 printf("RRR: failed to set crtc!!!!!!\n"); 616 printf("RRR: failed to set crtc!!!!!!\n");
617 if (E_INSIDE(px, py,
618 screenconf[i]->config.geom.x,
619 screenconf[i]->config.geom.y,
620 screenconf[i]->config.geom.w,
621 screenconf[i]->config.geom.h))
622 fix_pointer = EINA_FALSE;
623 px = screenconf[i]->config.geom.x +
624 (screenconf[i]->config.geom.w / 2);
625 py = screenconf[i]->config.geom.y +
626 (screenconf[i]->config.geom.h / 2);
613 ecore_x_randr_crtc_panning_area_set 627 ecore_x_randr_crtc_panning_area_set
614 (root, crtcs[i], 628 (root, crtcs[i],
615 screenconf[i]->config.geom.x, 629 screenconf[i]->config.geom.x,
@@ -644,6 +658,10 @@ e_comp_x_randr_config_apply(void)
644 ecore_x_root_screen_barriers_set(NULL, 0); 658 ecore_x_root_screen_barriers_set(NULL, 0);
645 } 659 }
646 } 660 }
661 if (fix_pointer)
662 {
663 ecore_x_pointer_warp(root, px, py);
664 }
647 free(outputs); 665 free(outputs);
648 free(crtcs); 666 free(crtcs);
649 667