pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/53994: libxosd incorectly plasing text with offset monitors



>Number:         53994
>Category:       pkg
>Synopsis:       libxosd incorectly plasing text with offset monitors
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 19 23:15:00 +0000 2019
>Originator:     Aran Clauson
>Release:        2018Q4
>Organization:
Western Washington University
>Environment:
NetBSD owl 8.99.31 NetBSD 8.99.31 (GENERIC) #0: Wed Jan 23 08:20:24 PST 2019  aran@owl:/home/NetBSD/obj/sys/arch/amd64/compile/GENERIC amd64

>Description:
I have two monitors with the primary monitor with position so the bottoms of both monitors align.  The osd text does not incorporate this position when placing things on the bottom of the screen.  

>How-To-Repeat:
Using xrandr, give the monitor a non-zero y-position.  Use osd_cat to display text at the bottom of the screen.  
>Fix:
--- src/libxosd/intern.h.orig   2019-02-19 22:10:02.161767111 +0000
+++ src/libxosd/intern.h
@@ -107,6 +107,7 @@ struct xosd
   int screen_width;             /* CONST x11 */
   int screen_height;            /* CONST x11 */
   int screen_xpos;              /* CONST x11 */
+  int screen_ypos;              /* CONST x11 */
   int height;                   /* CACHE (font) */
   int line_height;              /* CACHE (font) */
   xosd_pos pos;                 /* CONF */

--- src/libxosd/xosd.c.orig     2019-02-19 22:10:09.535111743 +0000
+++ src/libxosd/xosd.c
@@ -326,13 +326,13 @@ event_loop(void *osdv)
       }
       switch (osd->pos) {
       case XOSD_bottom:
-        y = osd->screen_height - osd->height - osd->voffset;
+        y = osd->screen_height + osd->screen_ypos - osd->height - osd->voffset;
         break;
       case XOSD_middle:
-        y = (osd->screen_height - osd->height) / 2 - osd->voffset;
+        y = (osd->screen_height  + osd->screen_ypos - osd->height) / 2 - osd->voffset;
         break;
       case XOSD_top:
-        y = osd->voffset;
+        y = osd->screen_ypos + osd->voffset;
       }
       XMoveWindow(osd->display, osd->window, x, y);
     }
@@ -746,12 +746,14 @@ xosd_create(int number_lines)
     osd->screen_width = screeninfo[0].width;
     osd->screen_height = screeninfo[0].height;
     osd->screen_xpos = screeninfo[0].x_org;
+    osd->screen_ypos = screeninfo[0].y_org;
   } else
 #endif
   {
     osd->screen_width = XDisplayWidth(osd->display, osd->screen);
     osd->screen_height = XDisplayHeight(osd->display, osd->screen);
     osd->screen_xpos = 0;
+    osd->screen_ypos = 0;
   }
 #ifdef HAVE_XINERAMA
   if (screeninfo)



Home | Main Index | Thread Index | Old Index