Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix glitches/crashes with high DPI displays #85

Merged
merged 2 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .ci_support/migrations/libthrift0150.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ index 8149cb5cb..c20360bd0 100644
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
--
2.30.2
2.32.0

2 changes: 1 addition & 1 deletion recipe/0002-cmake-Don-t-generate-.pyc-and-.pyo-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ index c20360bd0..ad0e41dd3 100644
endfunction(GR_PYTHON_INSTALL)

--
2.30.2
2.32.0

Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ index 316ecbdd0..63d79f69b 100644

class DummyCoreConnection(object):
--
2.30.2
2.32.0

Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ index ad0e41dd3..1397aac7e 100644
endforeach(pyfile)

--
2.30.2
2.32.0

Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ index ee354ba54..adc325cb9 100644

self.parser = configparser.ConfigParser()
--
2.30.2
2.32.0

Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,5 @@ index 843eea36f..8ea2d0606 100644
# Setup doxygen option
########################################################################
--
2.30.2
2.32.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ryan Volz <ryan.volz@gmail.com>
Date: Wed, 22 Sep 2021 16:23:43 -0400
Subject: [PATCH] grc: Add DPI scale factor for GRC drawing area widget.

This fixes scaling graphical glitches (e.g. drawing area occupies 1/4 of
the window) and crashes on high DPI displays.

Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
---
grc/gui/DrawingArea.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py
index 637a3e3e6..a5cc32b3d 100644
--- a/grc/gui/DrawingArea.py
+++ b/grc/gui/DrawingArea.py
@@ -154,7 +154,11 @@ class DrawingArea(Gtk.DrawingArea):

def _update_size(self):
w, h = self._flow_graph.get_extents()[2:]
- self.set_size_request(w * self.zoom_factor + 100, h * self.zoom_factor + 100)
+ scale_factor = self.get_scale_factor()
+ self.set_size_request(
+ w * scale_factor * self.zoom_factor + 100,
+ h * scale_factor * self.zoom_factor + 100,
+ )

def _auto_scroll(self, event):
x, y = event.x, event.y
--
2.32.0

3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ source:
- 0004-cmake-Pass-extra-arguments-to-GR_PYTHON_INSTALL-to-i.patch
- 0005-grc-Remove-global_blocks_path-preference-and-use-pre.patch
- 0006-cmake-Remove-absolute-paths-and-private-links-from-e.patch
- 0007-grc-Add-DPI-scale-factor-for-GRC-drawing-area-widget.patch

build:
number: 5
number: 6

requirements:
build:
Expand Down