You are not logged in.

#1 2023-01-26 17:53:35

Epp
Member
Registered: 2022-07-11
Posts: 75

[SOLVED] Change resolution for only one application

Hi,

In my .xprofile is this:

xrandr --output DP-0 --mode 1920x1080

And with success, so I can see things better on my screen.

Not really a problem, but it would be nice if  "uno-calculator" (the Windows calculator) opens in a size between what it now is and would be without the xrandr line (from above).

I saw that people recommended xdotools for changing the resolution.
Installing an application/package for only changing this, seems a bit overkill.

Can you please let me know if there is an alternative, perhaps with a sh script (for dmenu)?

Thanks!

Update:
Excuses, I think the text would be a bit more clear, by mentioning that the application window is floating, with the application window only covering a part of the screen. If possible, a smaller box would be nice.

Last edited by Epp (2023-01-29 00:25:43)

Offline

#2 2023-01-26 20:21:09

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

I saw that people recommended xdotools for changing the resolution.

Where? That's nonsense.

Installing an application/package for only changing this, seems a bit overkill.

xdotool would absolutely not help you here, but it's also only 185kB and generally *very* useful in an X11 environment.

And with success, so I can see things better on my screen.

How about making sure you're using the correct DPI and perhaps some HiDPI adjustments to make use of the higher resolution?
https://wiki.archlinux.org/title/HiDPI

There's no general way to run a single application w/ a different resolution.
There're environment variables for GTK and Qt, but that won't help you w/ some windows tool.
I'd try to change the font size of the calculator (if it allows for such)

The calculator *might* respond to the logical DPI

xdpyinfo | grep resolution # current value
xrandr --dpi 48 # lower resolution should render smaller text
uno-calculator & sleep 1 # briefly wait until the calculator is set up
xrandr --dpi 96 # restore the original resolution, "96" is an assumption

Everything started between the two xrandr calls will see a lower logical resolution, some (few) clients might even (undesiredly) respond to the change.

Offline

#3 2023-01-27 18:09:03

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

Where? That's nonsense.

Yes, I think you are right. Excuses. I cannot (fast enough) trace back how I came to this.

But wow, good news. This is looking obvious much better (sharper). Fast scrolling up and down webpages does now not lead to artifacts.

Xft.dpi: 192

It sadly brings along serious problems I think. I have not given up finding solutions.
But problems are tough enough to report back already.

Removing the display setting from .xprofile. Makes all smaller.

Xft.dip 192

This is the improvement. But not for the uno-calculator.

This meaning the size of the floating uno-calculator window is much smaller. This smaller size is more of a bother than it was before.
These settings in .xprofile also affect the other applications.

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5

Perhaps I should only use GDK_SCALE? I did not yet try this.

And icons are smaller in applications like Evolution and Keepass (and most like more).

As I typed before I don't give up already, but what could be a showstopper is some applications going off screen.
More precise. Only one application I know now. Again Evolution. The bottom of Evolution is totally off screen.
For what it's worth, the mouse pointer does also go off screen on the bottom (and on the right side of the display).

These dpi commands do not affect the uno-calculator

xdpyinfo | grep resolution # current value
xrandr --dpi 48 # lower resolution should render smaller text
uno-calculator & sleep 1 # briefly wait until the calculator is set up
xrandr --dpi 96 # restore the original resolution, "96" is an assumption

xdpyinfo did show the UHD resolution with the desired DPI. Thanks a lot for your help!

---
Update 1: Yes, also with only export GDK_SCALE=2 in .xprofile (for screen resolution) Evolution goes serious off screen at the bottom. Also giving other problems with small fonts in some applications. Bigger window for uno-calculator though.
(the same for export GDK_DPI_SCALE=2)

Update 2: It's almost for sure a DWM problem. I saw that after only Alt + right mouse click the window fell into perfect size/place.
Evolution was in monocle mode (forcing compose new email on top). Floating also floats out of the screen.
In tiling mode, the window fits perfect on the screen. Tiling mode is not exactly what I want for this application, but perhaps there's a fix for DWM, or I am just an idiot. For now time to sit back. Thanks!

Last edited by Epp (2023-01-27 21:34:05)

Offline

#4 2023-01-27 21:50:14

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

1. "Xft.dpi: 192" belongs into ~/.Xresources or ~/.Xdefaults - check "xrdb -q | grep dpi" to see whether it was actually applied
https://wiki.archlinux.org/title/x_resources
Inside ~/.xprofile, it will only cause a syntax error and not do anything.

2.

The bottom of Evolution is totaly off screen.
For what it's worth, the mouse pointer does also go off screen on the bottom (and on the right side of the display).

This suggests that the root window is bigger than the output

xrandr -q

3. If the GDK_* environment variable do impact the uno-calculator, you could apply them globally and specifically for the calculator
.xprofile

…
export GDK_SCALE=2
export GDK_DPI_SCALE=0.5
…

/usr/local/bin/uno-calculator #shadow the calculator w/ a script in /usr/local/bin, don't forget to chmod +x

#!/bin/sh
export GDK_SCALE=2
export GDK_DPI_SCALE=1
exec /usr/bin/uno-calculator

Offline

#5 2023-01-28 08:05:08

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

1.
I see now that I made it unclear, sorry. "Xft.dpi: 192" was in .Xresources not in .xprofile. The check confirms that it's actually applied.

2.

xrandr -q
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
HDMI-0 disconnected primary (normal left inverted right x axis y axis)
DP-0 connected 3840x2160+0+0 (normal left inverted right x axis y axis) 708mm x 399mm
   3840x2160     60.00*+  50.00    29.99    29.97    25.00    24.00    23.98  
   2560x1440     59.95  
   1920x1200     59.95    59.88  
   1920x1080     60.00    59.94    50.00  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      59.89  
   1440x576      50.00  
   1440x480      59.94  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-3 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
HDMI-1-4 disconnected (normal left inverted right x axis y axis)

3.
This is good. Thank you!
The uno-calculator box is big again. It does not need to be this big, but with obvious better screen quality, it's still looking good (not as if as it's stretched out too far).
It seems like a good addition to the DPI setting in .Xresources.

Offline

#6 2023-01-28 08:45:03

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

The uno-calculator box is big again. It does not need to be this big, but

You can use floats here, eg.

#!/bin/sh
export GDK_SCALE=1.5
export GDK_DPI_SCALE=1
exec /usr/bin/uno-calculator

The output configuration is ok, can you still move the cursor outside the screen?
How far?
Are you using a custom cursor theme?
(The "cursor" is actually an invisible point that typipcally aligns w/ the peak of a fancy graphic - it doesn't have to, though, and it if's off by two px and gets scaled x2, you can now move the fancy icon out of the screen by 4px)

Offline

#7 2023-01-28 09:40:05

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

The float number (1.5) is not working for me. The result of size 1.5 is the same as 1. Making it 2 doubles it.

The mouse is not really a problem for me. It was more meant as extra info. Reading your text it occurred to me that I am in the right corner, duh...
The point of the mouse pointer stays nice on the border of the screen. I never took notice of this before. Again, sorry for blurrry text.
On the bottom it's exact the full size of the mouse pointer height disappearing. On the right side of the screen it's exact the full width of the mouse pointer disappearing. With indeed the point of the mouse exact on the border of the screen.

The missing bottom from Evolution is way more. It's about 130px. Checked it with Gimp.
I am not using a mouse theme.

Last edited by Epp (2023-01-28 09:51:12)

Offline

#8 2023-01-28 15:50:18

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

I just noticed your earlier edit.

Update 2: It's almost for sure a DWM problem. I saw that after only Alt + right mouse click the window fell into perfect size/place.
Evolution was in monocle mode (forcing compose new email on top). Floating also floats out of the screen.
In tiling mode, the window fits perfect on the screen. Tiling mode is not exactly what I want for this application, but perhaps there's a fix for DWM, or I am just an idiot. For now time to sit back.

Evolution will probably remember it's size in line/column metrics and itself, or dwm, also store its position.
Restoring that and the amount of lines based on the increased line height will probably lead to it reaching out of the screen - that should however be solvable by resizing the evolution window or moving it to a different position and restarting it?

Offline

#9 2023-01-28 17:02:08

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

Although the DWM-bar is only a third of what's missing beneath Evolution, I had the feeling that at opening there is no indication for Evolution that there already is something on the screen.
The memory can be perhaps something  in a cache?
After resetting the size of Evolution (with Alt + only a single right mouse click on the upper side of Evolution), this size is not remembered.
I also tried it with different smaller sizes.

Offline

#10 2023-01-28 17:17:29

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

What's the output of "xprop" for the evolution window?
Do you use any DWM patches like eg. https://dwm.suckless.org/patches/sizehints/ ?

Offline

#11 2023-01-28 17:48:25

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

xprop

_GTK_APPLICATION_OBJECT_PATH(UTF8_STRING) = "/org/gnome/Evolution"
_GTK_UNIQUE_BUS_NAME(UTF8_STRING) = ":1.94"
_GTK_APPLICATION_ID(UTF8_STRING) = "org.gnome.Evolution"
_NET_WM_OPAQUE_REGION(CARDINAL) = 0, 0, 3850, 2242
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
WM_WINDOW_ROLE(STRING) = "EShellWindow-94027674764448"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 23068692, 23068693
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1600013
WM_CLIENT_LEADER(WINDOW): window id # 0x1600001
_NET_WM_PID(CARDINAL) = 28303
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "nameofmymachine"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified minimum size: 1282 by 566
		program specified base size: 0 by 0
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "evolution", "Evolution"
WM_ICON_NAME(STRING) = "Inbox"
_NET_WM_ICON_NAME(UTF8_STRING) = "Inbox"
WM_NAME(STRING) = "Inbox"
_NET_WM_NAME(UTF8_STRING) = "Inbox"

sizehints is not a patch I am using.
I just realized I need to log the patches better (in for example my config.h file). Without further study, these are the patches (on a clean DWM install):
   viewonrulestag
   viewontag
   nextprev
   pango

Last edited by Epp (2023-01-28 17:49:23)

Offline

#12 2023-01-28 20:36:20

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Change resolution for only one application

The window doesn't set USSize or PSize and probably resizes itself before mapping ("great", but pretty normal)
It's minimum size is drastically below its current size so it's not just because dwm would ignore restrictions only in tiled mode.

https://archlinux.org/packages/extra/x8 … nf-editor/
Look out for evolutions configurations and maybe search for "window-" (I couldn't google up the evolution config keys, sorry)

Offline

#13 2023-01-29 00:25:00

Epp
Member
Registered: 2022-07-11
Posts: 75

Re: [SOLVED] Change resolution for only one application

wow, super.
For the Evolution window I turned maximized off, changed the width, and more important height to 2030 in dconf-editor.
It now fits nicely in my screen in monocle mode. I am sure it never looked this good.
Thanks a lot for helping with these improvements!

Offline

Board footer

Powered by FluxBB