Skip to content

Conversation

@ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Nov 9, 2024

Fix popup position issue on Wayland and improve natural sizing

Wayland環境で多段ポップアップがマウスポインターから離れて表示される問題を修正します。

PopupWinコンストラクタの中ではGdk::Windowが関連付けされないため、realizeシグナルでウィンドウ操作を行います。
また、ポップアップ表示にgdk_window_move_to_rect()を使用し、表示サイズを自動調整するためSKELETON::Viewに自然サイズ用メソッドを追加しました。X11では従来の方法を維持し、適切な表示動作を実現します。

This commit fixes the issue where multi-level popups appear away from the mouse pointer on Wayland.

It adjusts PopupWin behavior by handling window operations on the realize signal, as Gdk::Window is not linked in the constructor. Popups now use gdk_window_move_to_rect() for automatic resizing, and SKELETON::View has added methods for natural sizing. On X11, the previous method remains in use, ensuring correct display behavior.

Adjust error message display size automatically in image popup

エラーメッセージを表示する際に固定サイズ(200x50)で表示される問題を修正します。
Gtk::Labelウィジェットから取得した自然なサイズ(natural size)を使用して、ビューの表示領域を適切なサイズに自動調整します。

  • adjust_client_size()メソッドを追加して自然なサイズを取得
  • エラーメッセージ表示時にウィジェットサイズを更新

Fix the issue where error messages are displayed with fixed size (200x50). Use the natural size obtained from Gtk::Label widget to automatically adjust the view area to an appropriate size.

  • Add update_client_size() method to get natural size
  • Update widget size when displaying error messages

Closes #1470

ma8ma added 2 commits November 9, 2024 22:21
Wayland環境で多段ポップアップがマウスポインターから離れて表示される
問題を修正します。

`PopupWin`コンストラクタの中では`Gdk::Window`が関連付けされないため、
`realize`シグナルでウィンドウ操作を行います。
また、ポップアップ表示に`gdk_window_move_to_rect()`を使用し、
表示サイズを自動調整するため`SKELETON::View`に自然サイズ用メソッドを
追加しました。X11では従来の方法を維持し、適切な表示動作を実現します。

This commit fixes the issue where multi-level popups appear away from
the mouse pointer on Wayland.

It adjusts `PopupWin` behavior by handling window operations on the
`realize` signal, as `Gdk::Window` is not linked in the constructor.
Popups now use `gdk_window_move_to_rect()` for automatic resizing,
and `SKELETON::View` has added methods for natural sizing. On X11,
the previous method remains in use, ensuring correct display behavior.
エラーメッセージを表示する際に固定サイズ(200x50)で表示される問題を
修正します。`Gtk::Label`ウィジェットから取得した自然なサイズ(natural
size)を使用して、ビューの表示領域を適切なサイズに自動調整します。

- `adjust_client_size()`メソッドを追加して自然なサイズを取得
- エラーメッセージ表示時にウィジェットサイズを更新

Fix the issue where error messages are displayed with fixed size
(200x50). Use the natural size obtained from Gtk::Label widget to
automatically adjust the view area to an appropriate size.

- Add `update_client_size()` method to get natural size
- Update widget size when displaying error messages
@ma8ma ma8ma added bug バグの追跡 gtk3 GTK3版に関するトピック labels Nov 9, 2024
@ma8ma ma8ma merged commit be4f5f9 into master Nov 9, 2024
@ma8ma ma8ma deleted the fix-popup-position-issue-on-wayland branch November 9, 2024 13:32
ma8ma added a commit that referenced this pull request Nov 9, 2024
Wayland環境における以下の制約事項をREADMEとオンラインマニュアルに
追記します。

- Waylandでは、親ウインドウから子ウインドウのポップアップを表示する際、
  一度に1つしか表示できません。そのため、スレビューのポップアップ表示中
  にメインウインドウのツールチップを同時に表示することはできません。

- Waylandで多段ポップアップを表示すると、マウスポインターから離れた
  位置に表示されることがあります。この問題はPR #1472で修正済みです。

- Waylandでは、多段ポップアップ表示中にマウスポインターを
  ポップアップ外に移動しても、ポップアップが消えない場合があります。
  この場合、Escキーを押すことでポップアップを閉じることができます。

Add the following constraints for the Wayland environment to the
README and online manual:

- In Wayland, only one popup can be displayed from a parent window at
  a time. Therefore, it is not possible to display a main window
  tooltip while a review popup is showing.

- When displaying nested popups in Wayland, they may appear far from
  the mouse pointer. This issue has been fixed in PR #1472.

- In Wayland, nested popups may not disappear when the mouse pointer
  is moved outside the popup. In such cases, pressing the Esc key
  will close the popup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug バグの追跡 gtk3 GTK3版に関するトピック

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Waylandで多段ポップアップを表示すると、マウスポインターから離れた位置に表示される

2 participants