pkgsrc-Changes archive

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

CVS commit: pkgsrc/emulators/tme



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Thu Aug 13 06:33:59 UTC 2020

Modified Files:
        pkgsrc/emulators/tme: Makefile distinfo
Added Files:
        pkgsrc/emulators/tme/patches: patch-host_gtk_gtk-screen.c

Log Message:
tme: avoid double-scaled screen on multi HD display environment.

It looks the original implementation assumed a single 4:3 display.
Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 pkgsrc/emulators/tme/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/emulators/tme/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/emulators/tme/patches/patch-host_gtk_gtk-screen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/emulators/tme/Makefile
diff -u pkgsrc/emulators/tme/Makefile:1.78 pkgsrc/emulators/tme/Makefile:1.79
--- pkgsrc/emulators/tme/Makefile:1.78  Thu Aug 13 05:59:51 2020
+++ pkgsrc/emulators/tme/Makefile       Thu Aug 13 06:33:59 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.78 2020/08/13 05:59:51 tsutsui Exp $
+# $NetBSD: Makefile,v 1.79 2020/08/13 06:33:59 tsutsui Exp $
 #
 
 DISTNAME=              tme-0.8
-PKGREVISION=           44
+PKGREVISION=           45
 CATEGORIES=            emulators
 MASTER_SITES=          http://csail.mit.edu/~fredette/tme/
 

Index: pkgsrc/emulators/tme/distinfo
diff -u pkgsrc/emulators/tme/distinfo:1.27 pkgsrc/emulators/tme/distinfo:1.28
--- pkgsrc/emulators/tme/distinfo:1.27  Thu Aug 13 05:59:51 2020
+++ pkgsrc/emulators/tme/distinfo       Thu Aug 13 06:33:59 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2020/08/13 05:59:51 tsutsui Exp $
+$NetBSD: distinfo,v 1.28 2020/08/13 06:33:59 tsutsui Exp $
 
 SHA1 (tme-0.8.tar.gz) = dd4f3421c20ceed548c5328a21dbb26e80f46b9c
 RMD160 (tme-0.8.tar.gz) = 6bd505c5fa7810d37f436883383c4ba655df2ded
@@ -9,6 +9,7 @@ SHA1 (patch-configure.in) = 9795ad35a166
 SHA1 (patch-host_bsd_Makefile.am) = db0add22732e95b18886877a92e57e1a19d3099f
 SHA1 (patch-host_bsd_Makefile.in) = 0c361aca770ec7e323cef150e0e1b29d6a442306
 SHA1 (patch-host_bsd_bsd-if.c) = 929ddb1cbf3cbbc84dc9b1c8facba42032857dfa
+SHA1 (patch-host_gtk_gtk-screen.c) = 2f4da0467e6028066c70552dceef6df42c42f2c2
 SHA1 (patch-host_posix_posix-serial.c) = b1e009d6432c49672ca07a16ced939c8a46ef6e2
 SHA1 (patch-ic_ieee754_ieee754-misc-auto.sh) = afeb7452ef64bcae71e4dbae21881cff12cb9d4f
 SHA1 (patch-ic_m68k_m6888x.c) = fe42dce7bf5abc69e2c9e15967d5e862ef651a0e

Added files:

Index: pkgsrc/emulators/tme/patches/patch-host_gtk_gtk-screen.c
diff -u /dev/null pkgsrc/emulators/tme/patches/patch-host_gtk_gtk-screen.c:1.1
--- /dev/null   Thu Aug 13 06:34:00 2020
+++ pkgsrc/emulators/tme/patches/patch-host_gtk_gtk-screen.c    Thu Aug 13 06:33:59 2020
@@ -0,0 +1,55 @@
+$NetBSD: patch-host_gtk_gtk-screen.c,v 1.1 2020/08/13 06:33:59 tsutsui Exp $
+
+- Check also screen width and height to choose default screen size
+  for modern HD and multi display environments
+
+--- host/gtk/gtk-screen.c.orig 2009-08-30 21:39:03.000000000 +0000
++++ host/gtk/gtk-screen.c
+@@ -171,6 +171,8 @@ _tme_gtk_screen_mode_change(struct tme_f
+   const struct tme_fb_xlat *fb_xlat_a;
+   int scale;
+   unsigned long fb_area, avail_area, percentage;
++  unsigned long fb_width, fb_height, screen_width, screen_height;
++  unsigned long hpercentage, wpercentage;
+   gint width, height;
+   gint height_extra;
+   const void *map_g_old;
+@@ -207,23 +209,32 @@ _tme_gtk_screen_mode_change(struct tme_f
+   scale = screen->tme_gtk_screen_fb_scale;
+   if (scale < 0) {
+ 
++    fb_width  = conn_fb_other->tme_fb_connection_width;
++    fb_height = conn_fb_other->tme_fb_connection_height;
++    screen_width  = gdk_screen_width();
++    screen_height = gdk_screen_height();
++
+     /* calulate the areas, in square pixels, of the emulated
+        framebuffer and the host's screen: */
+-    fb_area = (conn_fb_other->tme_fb_connection_width
+-             * conn_fb_other->tme_fb_connection_height);
+-    avail_area = (gdk_screen_width()
+-                * gdk_screen_height());
++    fb_area = fb_width * fb_height;
++    avail_area = screen_width * screen_height;
+ 
+     /* see what percentage of the host's screen would be taken up by
+        an unscaled emulated framebuffer: */
+     percentage = (fb_area * 100) / avail_area;
+ 
++    /* also check percentage of the actual host's screen width and height
++       for modern HD or multi displays */
++    wpercentage = (fb_width  * 100) / screen_width;
++    hpercentage = (fb_height * 100) / screen_height;
++
+     /* if this is at least 70%, halve the emulated framebuffer, else
+        if this is 30% or less, double the emulated framebuffer: */
+-    if (percentage >= 70) {
++    /* also check screen width and height fit the emulated framebuffer */
++    if (percentage >= 70 || wpercentage > 100 || hpercentage > 100) {
+       scale = TME_FB_XLAT_SCALE_HALF;
+     }
+-    else if (percentage <= 30) {
++    else if (percentage <= 30 && wpercentage <= 50 && hpercentage <= 50) {
+       scale = TME_FB_XLAT_SCALE_DOUBLE;
+     }
+     else {



Home | Main Index | Thread Index | Old Index