Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wayland): decoration not clickable when initial visible is false #1055

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

yuezk
Copy link

@yuezk yuezk commented Feb 9, 2025

Problem

The decoration is not clickable if the window initial visible is false.

Reproduce

  1. Run the following code
  2. The close button, the maximum button, and the minimum button is not clickable.
use tao::{
  event::{Event, WindowEvent},
  event_loop::{ControlFlow, EventLoop},
  window::WindowBuilder,
};

#[allow(clippy::single_match)]
fn main() {
  env_logger::init();
  let event_loop = EventLoop::new();

  let window = WindowBuilder::new()
    .with_visible(false)
    .with_title("A fantastic window!")
    .build(&event_loop)
    .unwrap();

  window.set_visible(true);

  event_loop.run(move |event, _, control_flow| {
    *control_flow = ControlFlow::Wait;

    match event {
      Event::WindowEvent {
        event: WindowEvent::CloseRequested,
        ..
      } => *control_flow = ControlFlow::Exit,
      _ => (),
    }
  });
}

Solution

Avoid setting the above child property of the EventBox. The default value is false. Seems there is no need to set it to true.

https://docs.gtk.org/gtk3/method.EventBox.set_above_child.html

Copy link
Contributor

github-actions bot commented Feb 9, 2025

Package Changes Through 6f278c7

There are 1 changes which include tao with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.31.1 0.32.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant