lingtjien/Grid-Tiling-Kwin

Marktext app not displaying correctly

Closed this issue · 8 comments

Hi!

First of all, thank you very much for your work. I use your script and love every minute with it.
After couple months of use, this is the first time I encountered a problem.

I started using MarkText for note taking and with it's default settings it can only display it's initial size. If I want to make it bigger, -for example want to make it fullscreen-, the remaining pixels stay transparent.
Initial size(the whole windows should be black, but the bottom stay transparent):
Marktext_1
Fullscreen size(the right side is transparent):
Marktext_2

There is a Title bar style settings in the App's preferences. If I set it to native, the fullscreen works and the windows resizing also, but a ugly tool bar appears.
Marktext_3
Tool bar:
Marktext_4

I would like to keep the Title bar settings on custom. Do you have any idea, how could I fix this resizing issue?

So the border is always the correct size (correctly tiled)? It's just the content inside that has the wrong dimensions?

(Side note, if you use the global menu widget the toolbar gets placed in there and removed from the application, it's what I use to get a more clean esthetic)

Yes, as you can see it here: (with native titlebar)
Marktext_5

With custom titlebar, the border looks good too, but you can already see the missing parts on the bottom and right side:
Marktext_6

I can't really do anything about that. I can only control the size of the window, which is basically the borders, but what's inside the border is up to the developer of that application.

Seems to me like the custom titlebar option of the application does not correctly resize the content when the window changes size.

What happens if you hold the border and drag it along, does the content also resize or does it stay the same size?

Alright, I found something.
If I first make it a floating windows(Meta+T), then maximize it(Meta+W), then unfloat it and finally unmaximize it, the content is correctly resizied. No matter what size I make it.
Is it possible to create a script or something, maybe a launch parameter, to do the above commands in order when I open this specific application?

Could you try to resize the window by dragging the border and see if that fixes the graphical glitch and resizes the content?

To answer your question, I believe you could do that through a simple bash script using xprop (assuming you're on X11) and run that script in the Exec field of the .desktop file.

Yes, I tried it, but it didn't work.
The content remains around the same size.
Marktext_7png

Marktext_8

If I make the window smaller, than the original size was, it looks like it's nicely fits in the new border size, but actually the content doesn't get resized. :(

I was able to come up with a workaround. Not perfect, not nice, but it works. :D

#!/bin/bash
marktext &
##Wait till the window gets created
until [[ $(xdotool search --class marktext | wc -l) -gt 0 ]]; do
 :
done
sleep 1.5
id=$(xdotool search --class marktext)

##Makes sure the right windows is in focus (selected)
xdotool windowactivate $id
##Fullscreen the window
xdotool key Super_R+w > /dev/null
xdotool windowactivate $id
##Floats the windows
xdotool key Super_R+t > /dev/null
sleep 0.1
xdotool windowactivate $id
##Unfloat
xdotool key Super_R+t > /dev/null
xdotool windowactivate $id
##Unfullscreen
xdotool key Super_R+w > /dev/null

The order is important.

Thanks for the help @lingtjien ! Going to continue using your script <3

If I make the window smaller, than the original size was, it looks like it's nicely fits in the new border size, but actually the content doesn't get resized. :(

Yikes... Guess the application only resizes the content when it's minimized/maximized...

Thanks for the help @lingtjien ! Going to continue using your script <3

You did the work 👍 I just gave a hint where to look 😄