[Github-comments] [geany/geany] Fix: winpos/winsize/sidebarpos restored incorrectly (#2195)

Faimerth notifications at xxxxx
Sun Jun 16 16:33:53 UTC 2019


- Try to solve this issue #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 (1046ea49) ---- with configuration (msgwin bottom/right, sidebar left/right, (un)save winpos/size), 
GTK 3.18.9.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/2195

-- Commit Summary --

  * minimal window size
  * remake geometry restoration function

-- File Changes --

    M src/geany.h (2)
    M src/keyfile.c (68)
    M src/libmain.c (21)
    M src/main.h (2)
    M src/prefs.c (2)
    M src/ui_utils.c (21)
    M src/ui_utils.h (4)

-- Patch Links --

https://github.com/geany/geany/pull/2195.patch
https://github.com/geany/geany/pull/2195.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2195
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190616/1267e6c7/attachment.html>


More information about the Github-comments mailing list