Skip to content

Problems interacting with examples\custom_window_frame #3669

@rustbasic

Description

@rustbasic

Subject: "examples\custom_window_frame" issue

Dear emilk,

I'm re-raising the issue regarding the "examples\custom_window_frame" that I posted earlier,
as it has not been addressed in v0.24.1.
Even if double_clicked() is not working, clicked() should still function.

After running "examples\custom_window_frame",
when double-clicking on the title bar, the window does not maximize.
The dragging functionality works well when the title bar is clicked and held.

    if title_bar_response.double_clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }

In "examples\custom_window_frame," checking only for double_clicked() as follows is fine (no problem) :

    if title_bar_response.double_clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
/*
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }
*/

In "examples\custom_window_frame," even when double_clicked() is changed to clicked(),
if there is else if title_bar_response.is_pointer_button_down_on(), clicked() does not work.

    if title_bar_response.clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }

Thanks, emilk.

Library: egui v0.24.0, egui v0.24.1
OS: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenhelp wantedExtra attention is needednative-windowsRunning on native Windows OSrerunDesired for Rerun.io

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions