processing / processing/libprocessing

Window size discrepancy on HighDPI monitor

Open
#198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
69
Forks
14
Avg merge
15d 22h
Merged PRs (30d)
3

Description

Running the same sketch on a HighDPI monitor appears to create a larger window than necessary.

4K HighDPI monitor

Image

1080p monitor

Image

Version: mewnala 0.0.7

Code

"""
Redraw. 
  
The redraw() function makes draw() execute once.    
In this example, draw() is executed once every time 
the mouse is clicked. 
"""
from mewnala import *

y = 180

def setup():
    """ 
    The statements in the setup() function 
    execute once when the program begins.
    """
    size(640, 360)    # Size should be the first statement
    stroke(255)         # Set line drawing color to white
    no_loop()


def draw():
    """
    The statements in draw() are executed until the
    program is stopped. Each statement is executed in
    sequence and after the last line is read, the first
    line is executed again.
    """
    global y
    background(0)     # Set the background to black
    y = y - 4
    if (y < 0):
        y = height
    line(0, y, width, y)


def mouse_pressed():
    redraw()

run()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the size(640, 360) call in the provided sketch and compare the window-creation and HighDPI behavior on the two monitor types. Trace the window sizing entry point in the implementation; done means the same sketch produces the intended, consistent window size on HighDPI and standard displays.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.