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

Maximized windows are not restored correctly on startup #5259

Open
kpcee opened this issue Nov 5, 2023 · 13 comments
Open

Maximized windows are not restored correctly on startup #5259

kpcee opened this issue Nov 5, 2023 · 13 comments

Comments

@kpcee
Copy link

kpcee commented Nov 5, 2023

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

Alexey-T added a commit that referenced this issue Nov 6, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented Nov 6, 2023

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 Alexey-T added the bug label Nov 6, 2023
@Alexey-T Alexey-T assigned Alexey-T and unassigned Alexey-T Nov 6, 2023
@kpcee
Copy link
Author

kpcee commented Nov 6, 2023

Wow thanks for the quick reply. 👍 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.

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 6, 2023

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
Copy link
Owner

Alexey-T commented Nov 6, 2023

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

@kpcee
Copy link
Author

kpcee commented Nov 6, 2023

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.

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 6, 2023

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

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 6, 2023

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
Copy link
Owner

Alexey-T commented Nov 6, 2023

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

@kpcee
Copy link
Author

kpcee commented Nov 7, 2023

Okay I will test it later today on a laptop.

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 7, 2023

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')

@kpcee
Copy link
Author

kpcee commented Nov 7, 2023

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

Test

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 7, 2023

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

@kpcee
Copy link
Author

kpcee commented Nov 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants