Skip to content

Conversation

@ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jan 5, 2025

ウインドウ(メイン、書き込みビュー、画像ビュー)のサイズ変更イベント処理を修正し、画像ビューの折りたたむ機能が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/height may 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 on event->width and event->height. Additionally, the slot_realize() function, which is no longer needed due to this change, has been removed.

ウインドウ(メイン、書き込みビュー、画像ビュー)の
サイズ変更イベント処理を修正し、画像ビューの折りたたむ機能が
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/height` may
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 on `event->width` and
`event->height`.  Additionally, the `slot_realize()` function, which
is no longer needed due to this change, has been removed.
@ma8ma ma8ma added the bug バグの追跡 label Jan 5, 2025
@ma8ma ma8ma merged commit 56e8a33 into master Jan 5, 2025
20 checks passed
@ma8ma ma8ma deleted the fix-image-view-window-folding-not-working-on-wayland branch January 5, 2025 13:36
ma8ma added a commit that referenced this pull request Jan 5, 2025
Waylandに関連する問題点と解決状況についてREADMEおよびマニュアルを
更新します。

- 画像ビュー(ウインドウ表示)のフォーカスが外れた場合に
  折りたたむ機能が正常に動作しない問題は[PR #1498][1]で修正しました。
  ただし、Westonではこの動作が意図した通りに発動しない場合があります。

- WestonでWaylandをバックエンドに指定して起動した際、ポップアップ内で
  右クリックするとプログラムがクラッシュする可能性がある問題について、
  既知の問題として追記しました。

- 修正済みの問題に打ち消し線を追加し、該当PR番号を明記しました。

- 修正無しで問題が解消した場合は、確認した環境を明記しました
  (Weston 13.0.3)。

今回のコミットでは、ソースコードの変更はありません。
ドキュメントのみを更新しています。

This update enhances the documentation regarding Wayland-related
issues and their resolutions.

- The issue where the fold-on-focus-out functionality for the image
  view (window display) did not work as expected was resolved
  in [PR #1498][1]. However, this behavior may not work as intended
  in Weston.

- Added information about a known issue where the program might crash
  when right-clicking within a popup in Weston while using Wayland as
  the backend.

- Added strikethroughs to resolved issues and referenced the
  respective PR numbers.

- Documented environments where unresolved issues were confirmed to
  be resolved (Weston 13.0.3).

This commit includes documentation updates only; there are no changes
to the source code.

[1]: #1498
ma8ma added a commit that referenced this pull request Jan 5, 2025
Waylandに関連する問題点と解決状況についてREADMEおよびマニュアルを
更新します。

- 画像ビュー(ウインドウ表示)のフォーカスが外れた場合に
  折りたたむ機能が正常に動作しない問題は[PR #1498][1]で修正しました。
  ただし、Westonではこの動作が意図した通りに発動しない場合があります。

- WestonでWaylandをバックエンドに指定して起動した際、ポップアップ内で
  右クリックするとプログラムがクラッシュする可能性がある問題について、
  既知の問題として追記しました。

- 修正済みの問題に打ち消し線を追加し、該当PR番号を明記しました。

- 修正無しで問題が解消した場合は、確認した環境を明記しました
  (Weston 13.0.3)。

今回のコミットでは、ソースコードの変更はありません。
ドキュメントのみを更新しています。

This update enhances the documentation regarding Wayland-related
issues and their resolutions.

- The issue where the fold-on-focus-out functionality for the image
  view (window display) did not work as expected was resolved
  in [PR #1498][1]. However, this behavior may not work as intended
  in Weston.

- Added information about a known issue where the program might crash
  when right-clicking within a popup in Weston while using Wayland as
  the backend.

- Added strikethroughs to resolved issues and referenced the
  respective PR numbers.

- Documented environments where unresolved issues were confirmed to
  be resolved (Weston 13.0.3).

This commit includes documentation updates only; there are no changes
to the source code.

[1]: #1498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug バグの追跡

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants