<ul>
<li>Try to solve this issue <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="254184869" data-permission-text="Issue title is private" data-url="https://github.com/geany/geany/issues/1593" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/1593/hovercard" href="https://github.com/geany/geany/issues/1593">#1593</a>. It is meaningless to save maximized window's size. Now geany "can restore to window sizeA" after unmaximizing.</li>
<li><strong>Right</strong> sidebar's position will be incorrectly restored with "save winsize/pos" unchecked or "msgwin right" checked.<br>
The former is because <code>gtk_widget_get_allocated_width(pane)</code> get '1' at startup.<br>
<code> src/ui_utils.c: void ui_swap_sidebar_pos(void):</code><br>
<code>gtk_paned_set_position(GTK_PANED(pane), gtk_widget_get_allocated_width(pane) - gtk_paned_get_position(GTK_PANED(pane)));</code><br>
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.</li>
<li>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.</li>
</ul>
<p>Test with:<br>
Ubuntu 16.04,<br>
Geany 1.36 (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/geany/geany/commit/1046ea49a2d9fbba79fb80043ebc5690d306db78/hovercard" href="https://github.com/geany/geany/commit/1046ea49a2d9fbba79fb80043ebc5690d306db78"><tt>1046ea4</tt></a>) ---- with configuration (msgwin bottom/right, sidebar left/right, (un)save winpos/size),<br>
GTK 3.18.9.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/2195'>https://github.com/geany/geany/pull/2195</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>minimal window size</li>
  <li>remake geometry restoration function</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-0">src/geany.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-1">src/keyfile.c</a>
    (68)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-2">src/libmain.c</a>
    (21)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-3">src/main.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-4">src/prefs.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-5">src/ui_utils.c</a>
    (21)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2195/files#diff-6">src/ui_utils.h</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/2195.patch'>https://github.com/geany/geany/pull/2195.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/2195.diff'>https://github.com/geany/geany/pull/2195.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2195?email_source=notifications&email_token=AAIOWJZBGHLH3AF57CRHDFLP2ZTPDA5CNFSM4HYRRLYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZYCCAA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6OXHSOWVSIHLTDKEDP2ZTPDANCNFSM4HYRRLYA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJ3TL2KFIRWTYL3AFG3P2ZTPDA5CNFSM4HYRRLYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZYCCAA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2195?email_source=notifications\u0026email_token=AAIOWJZBGHLH3AF57CRHDFLP2ZTPDA5CNFSM4HYRRLYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZYCCAA",
"url": "https://github.com/geany/geany/pull/2195?email_source=notifications\u0026email_token=AAIOWJZBGHLH3AF57CRHDFLP2ZTPDA5CNFSM4HYRRLYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZYCCAA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>