CudaText icon indicating copy to clipboard operation
CudaText copied to clipboard

Maximized windows are not restored correctly on startup

Open kpcee opened this issue 1 year ago • 13 comments

The CudaText window is not restored correctly after closing and restarting the application. Instead, the window is opened much too large, so that it is larger than the screen and the status bar and lower icons are not usable. To solve the problem, I have to maximize the window again so that it is displayed correctly. However, the next time I start the application, the problem reappears, which is annoying in the long run. Can this be changed?

CudaText 1.201.0.2, linux-x86_64-gtk2, fpc 3.2.3 Xfce Desktop (GTK), X11, ArchLabs (Arch Linux)

Here is a screenshot of how a maximized window looks on the desktop and is cut off at the bottom. Example

kpcee avatar Nov 05 '23 15:11 kpcee

i see it little differently on Ubuntu (gnome). made a fix. must be better now? gtk2 binary:

cudatext_gtk2.zip

on Qt5 or Windows, problem is not visible.

Alexey-T avatar Nov 06 '23 06:11 Alexey-T

Wow thanks for the quick reply. :thumbsup: I have tried the new binary and unfortunately it does not work for me. If I now close the window maximized, the next time it opens as a normal window with the size and position from where it was last closed not maximized.

kpcee avatar Nov 06 '23 09:11 kpcee

somehow WindowState:= wsMaximized don't work for you. can you try on another Linux distro and/or another Desktop ?

also, look at settings/history.json: if you quit in maximized state file must have

{
  "pos" : {
    "main_max" : true,

is it so?

Alexey-T avatar Nov 06 '23 09:11 Alexey-T

and 3rd question. this is demo which has button to maximize the window. project1_maxi.zip

(run binary project1)

press the button. when window is on every your monitor. it works?

Screenshot from 2023-11-06 13-02-52

Alexey-T avatar Nov 06 '23 10:11 Alexey-T

Unfortunately I don't have another desktop installed at the moment, I would have to download another live distribution first. The following entries can be found in history.json, I tested it with the original binary.

  "pos" : {
    "main_max" : true,
    "main" : "100,100,800,600",
    "main_mon" : 0
  },

and 3rd question. this is demo which has button to maximize the window.

When I press the button of the app, the window is maximized successfully.

kpcee avatar Nov 06 '23 14:11 kpcee

I cannot repro this yet, on Ubuntu 20.4 (gnome). i will try on Xubuntu later.

Alexey-T avatar Nov 06 '23 16:11 Alexey-T

tried on Xubuntu (with Xfce desktop). now it is working for me. note: Xfce shows the same plus icon on the form caption for normal and maximized window. so we are stuck, 'cannot reproduce'. can you try Xubuntu too?

Alexey-T avatar Nov 06 '23 16:11 Alexey-T

(make sure you overwrote the file cudatext which is usually in the /usr/bin, with my new copy).

Alexey-T avatar Nov 06 '23 16:11 Alexey-T

Okay I will test it later today on a laptop.

kpcee avatar Nov 07 '23 10:11 kpcee

new demo modulates the work of Cud. it makes maximized state in OnShow, like Cud. it must show as maximized and Aqua-colored panel must be maximized too with border=10pixels. pls test. maybe it is maximized wrong?

tst-WindowState_max.zip

(file 'project1')

Alexey-T avatar Nov 07 '23 13:11 Alexey-T

That works great, the window is displayed maximized! Here is a resized screenshot.

Test

kpcee avatar Nov 07 '23 15:11 kpcee

thanks. so Lazarus works good in demo. let's test updated Cud on different Linux.

Alexey-T avatar Nov 07 '23 15:11 Alexey-T

I have now tested it with Xubuntu and the result is as follows:

Cudatext_gtk2.zip works with Xubuntu but not with ArchLabs

Tst-WindowState_max.zip works with Xubuntu and ArchLabs

kpcee avatar Nov 07 '23 16:11 kpcee