fix(headerbar): double click handling & resize only on press
This commit is contained in:
parent
01f1785af5
commit
b28a435b18
5 changed files with 29 additions and 17 deletions
|
|
@ -1130,6 +1130,7 @@ impl Program for CosmicStackInternal {
|
|||
.to_i32_round();
|
||||
cursor.y -= TAB_HEIGHT;
|
||||
let res = shell.menu_request(
|
||||
false,
|
||||
&surface,
|
||||
&seat,
|
||||
serial,
|
||||
|
|
@ -1172,6 +1173,7 @@ impl Program for CosmicStackInternal {
|
|||
.to_i32_round();
|
||||
cursor.y -= TAB_HEIGHT;
|
||||
let res = shell.menu_request(
|
||||
false,
|
||||
&surface,
|
||||
&seat,
|
||||
serial,
|
||||
|
|
|
|||
|
|
@ -773,6 +773,7 @@ impl Program for CosmicWindowInternal {
|
|||
cursor.y -= SSD_HEIGHT;
|
||||
|
||||
let res = shell.menu_request(
|
||||
false,
|
||||
&surface,
|
||||
&seat,
|
||||
serial,
|
||||
|
|
@ -1031,6 +1032,13 @@ impl PointerTarget<State> for CosmicWindow {
|
|||
let Some(surface) = self.wl_surface().map(Cow::into_owned) else {
|
||||
return;
|
||||
};
|
||||
|
||||
// Only start a resize if the left button was pressed
|
||||
if event.state != smithay::backend::input::ButtonState::Pressed
|
||||
|| event.button != 0x110
|
||||
{
|
||||
return;
|
||||
}
|
||||
self.0.loop_handle().insert_idle(move |state| {
|
||||
let res = state.common.shell.write().resize_request(
|
||||
&surface,
|
||||
|
|
|
|||
|
|
@ -3429,6 +3429,7 @@ impl Shell {
|
|||
|
||||
pub fn menu_request(
|
||||
&self,
|
||||
is_client_initiated: bool,
|
||||
surface: &WlSurface,
|
||||
seat: &Seat<State>,
|
||||
serial: impl Into<Option<Serial>>,
|
||||
|
|
@ -3439,7 +3440,7 @@ impl Shell {
|
|||
) -> Option<(MenuGrab, Focus)> {
|
||||
let serial = serial.into();
|
||||
let Some(GrabStartData::Pointer(start_data)) =
|
||||
check_grab_preconditions(seat, serial, Some(surface))
|
||||
check_grab_preconditions(seat, serial, is_client_initiated.then_some(surface))
|
||||
else {
|
||||
return None; // TODO: an application can send a menu request for a touch event
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue