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

Fix: winsize/sidebarpos restored incorrectly #2195

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

faimerth
Copy link

@faimerth faimerth commented Jun 16, 2019

This PR mitigated the following bugs related to msgwin/sidebar/wingeom setup:

  • Issue geany cannot restore previous window size (reopen after maximized) #1593. It is meaningless to save maximized window's size. Now geany "can restore to window sizeA" after unmaximizing.
  • Right sidebar's position will be incorrectly restored with "save winsize/pos" unchecked or "msgwin right" checked.
    The former is because gtk_widget_get_allocated_width(pane) get '1' at startup.
    src/ui_utils.c: void ui_swap_sidebar_pos(void):
    gtk_paned_set_position(GTK_PANED(pane), gtk_widget_get_allocated_width(pane) - gtk_paned_get_position(GTK_PANED(pane)));
    The later is because sidebar position's setup is prior to msgwin's setup. If msgwin is too wide, sidebar's position will get inside the msgwin.
  • Potential Fault: "Preference->change msgwin orientations->Apply". Because config file saved before the ui update, the wrong position but the correct orientation of msgwin will be recorded. If crash happened before gently exiting, geany will show wrong layout at next start. Hence the ui update of main window should be prior to config file saving.

Test with:
Ubuntu 16.04,
Geany 1.36 (1046ea4) ---- with configuration (msgwin bottom/right, sidebar left/right, (un)save winpos/size),
GTK 3.18.9.

@codebrainz
Copy link
Member

I only had a quick glance at the code, no comment about the purpose of the PR, but more of a note for future cleanup/merging. You should follow the Geany code style (documented in HACKING and found in neighboring code), stuff like putting spaces between operators and operands. Also you shouldn't leave pointless stuff like if (1) branches.

@faimerth faimerth changed the title Fix: winpos/winsize/sidebarpos restored incorrectly Fix: winsize/sidebarpos restored incorrectly Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants