Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/emulators/tme tme: avoid double-scaled screen on multi...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2452e1b82fa
branches:  trunk
changeset: 436965:c2452e1b82fa
user:      tsutsui <tsutsui%pkgsrc.org@localhost>
date:      Thu Aug 13 06:33:59 2020 +0000

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

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

diffstat:

 emulators/tme/Makefile                            |   4 +-
 emulators/tme/distinfo                            |   3 +-
 emulators/tme/patches/patch-host_gtk_gtk-screen.c |  55 +++++++++++++++++++++++
 3 files changed, 59 insertions(+), 3 deletions(-)

diffs (90 lines):

diff -r 13d4e31b528e -r c2452e1b82fa emulators/tme/Makefile
--- a/emulators/tme/Makefile    Thu Aug 13 05:59:51 2020 +0000
+++ b/emulators/tme/Makefile    Thu Aug 13 06:33:59 2020 +0000
@@ -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/
 
diff -r 13d4e31b528e -r c2452e1b82fa emulators/tme/distinfo
--- a/emulators/tme/distinfo    Thu Aug 13 05:59:51 2020 +0000
+++ b/emulators/tme/distinfo    Thu Aug 13 06:33:59 2020 +0000
@@ -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-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
diff -r 13d4e31b528e -r c2452e1b82fa emulators/tme/patches/patch-host_gtk_gtk-screen.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-host_gtk_gtk-screen.c Thu Aug 13 06:33:59 2020 +0000
@@ -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