Fix image view window folding not working on Wayland #1498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ウインドウ(メイン、書き込みビュー、画像ビュー)のサイズ変更イベント処理を修正し、画像ビューの折りたたむ機能がWayland環境でも正常に動作するよう対応します。
背景:
一部のウィンドウマネージャーでは、
event->width/heightの値にClient-side decoration (CSD)などの装飾が含まれている可能性があります。Gtk::Window::resize()はウィンドウのコンテンツ領域(クライアント領域)を指定したサイズに変更するため、装飾が含まれたサイズを渡すと、保存したサイズに正しく復元しません。代わりに、コンテンツ領域のサイズ保存に適しているGtk::Window::get_size()を使用します。修正内容:
サイズ変更イベント処理において、
event->widthおよびevent->heightからウィンドウサイズを取得する代わりに、get_size()を使用するように変更しました。また、この変更に伴い、不要になった
slot_realize()関数を削除しました。This commit modifies the window resize event handling for the main, write, and image view windows to ensure the fold functionality in the image view works correctly in Wayland environments.
Background:
In some window managers, the values of
event->width/heightmay include decorations such as Client-side decorations (CSD).Gtk::Window::resize()changes the size of the window's content area (client area) to the specified size. Passing a size that includes decorations will prevent it from being restored to the saved size correctly. Instead,Gtk::Window::get_size(), which is suitable for saving the content area size, is used.Details of the fix:
In the resize event handling, the code is changed to use
get_size()to obtain the window size instead of relying onevent->widthandevent->height. Additionally, theslot_realize()function, which is no longer needed due to this change, has been removed.