Track if a move or resize request is client initiated
This commit is contained in:
parent
3625454420
commit
3c24934f48
7 changed files with 18 additions and 10 deletions
|
|
@ -888,6 +888,7 @@ impl State {
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
drop(shell);
|
drop(shell);
|
||||||
dispatch_grab(res, seat_clone, serial, state);
|
dispatch_grab(res, seat_clone, serial, state);
|
||||||
|
|
@ -910,7 +911,8 @@ impl State {
|
||||||
&surface,
|
&surface,
|
||||||
&seat_clone,
|
&seat_clone,
|
||||||
serial,
|
serial,
|
||||||
edge
|
edge,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
drop(shell);
|
drop(shell);
|
||||||
dispatch_grab(res, seat_clone, serial, state);
|
dispatch_grab(res, seat_clone, serial, state);
|
||||||
|
|
|
||||||
|
|
@ -622,6 +622,7 @@ impl CosmicStack {
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -710,6 +711,7 @@ impl Program for CosmicStackInternal {
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -1290,6 +1292,7 @@ impl PointerTarget<State> for CosmicStack {
|
||||||
Focus::ResizeRight => ResizeEdge::RIGHT,
|
Focus::ResizeRight => ResizeEdge::RIGHT,
|
||||||
Focus::Header => unreachable!(),
|
Focus::Header => unreachable!(),
|
||||||
},
|
},
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -1356,6 +1359,7 @@ impl PointerTarget<State> for CosmicStack {
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,7 @@ impl Program for CosmicWindowInternal {
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -718,6 +719,7 @@ impl PointerTarget<State> for CosmicWindow {
|
||||||
Focus::ResizeRight => ResizeEdge::RIGHT,
|
Focus::ResizeRight => ResizeEdge::RIGHT,
|
||||||
Focus::Header => unreachable!(),
|
Focus::Header => unreachable!(),
|
||||||
},
|
},
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some((grab, focus)) = res {
|
if let Some((grab, focus)) = res {
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ pub fn window_items(
|
||||||
&state.common.config,
|
&state.common.config,
|
||||||
&state.common.event_loop_handle,
|
&state.common.event_loop_handle,
|
||||||
&state.common.xdg_activation_state,
|
&state.common.xdg_activation_state,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
|
|
|
||||||
|
|
@ -2430,15 +2430,11 @@ impl Shell {
|
||||||
config: &Config,
|
config: &Config,
|
||||||
evlh: &LoopHandle<'static, State>,
|
evlh: &LoopHandle<'static, State>,
|
||||||
xdg_activation_state: &XdgActivationState,
|
xdg_activation_state: &XdgActivationState,
|
||||||
|
client_initiated: bool,
|
||||||
) -> Option<(MoveGrab, Focus)> {
|
) -> Option<(MoveGrab, Focus)> {
|
||||||
let serial = serial.into();
|
let serial = serial.into();
|
||||||
|
|
||||||
let mut start_data = check_grab_preconditions(
|
let mut start_data = check_grab_preconditions(&seat, surface, serial, client_initiated)?;
|
||||||
&seat,
|
|
||||||
surface,
|
|
||||||
serial,
|
|
||||||
release == ReleaseMode::NoMouseButtons && !move_out_of_stack,
|
|
||||||
)?;
|
|
||||||
let mut old_mapped = self.element_for_surface(surface).cloned()?;
|
let mut old_mapped = self.element_for_surface(surface).cloned()?;
|
||||||
if old_mapped.is_minimized() {
|
if old_mapped.is_minimized() {
|
||||||
return None;
|
return None;
|
||||||
|
|
@ -3072,9 +3068,10 @@ impl Shell {
|
||||||
seat: &Seat<State>,
|
seat: &Seat<State>,
|
||||||
serial: impl Into<Option<Serial>>,
|
serial: impl Into<Option<Serial>>,
|
||||||
edges: ResizeEdge,
|
edges: ResizeEdge,
|
||||||
|
client_initiated: bool,
|
||||||
) -> Option<(ResizeGrab, Focus)> {
|
) -> Option<(ResizeGrab, Focus)> {
|
||||||
let serial = serial.into();
|
let serial = serial.into();
|
||||||
let start_data = check_grab_preconditions(&seat, surface, serial, true)?;
|
let start_data = check_grab_preconditions(&seat, surface, serial, client_initiated)?;
|
||||||
let mapped = self.element_for_surface(surface).cloned()?;
|
let mapped = self.element_for_surface(surface).cloned()?;
|
||||||
if mapped.is_fullscreen(true) || mapped.is_maximized(true) {
|
if mapped.is_fullscreen(true) || mapped.is_maximized(true) {
|
||||||
return None;
|
return None;
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ impl XdgShellHandler for State {
|
||||||
&self.common.config,
|
&self.common.config,
|
||||||
&self.common.event_loop_handle,
|
&self.common.event_loop_handle,
|
||||||
&self.common.xdg_activation_state,
|
&self.common.xdg_activation_state,
|
||||||
|
true,
|
||||||
) {
|
) {
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -183,7 +184,7 @@ impl XdgShellHandler for State {
|
||||||
let seat = Seat::from_resource(&seat).unwrap();
|
let seat = Seat::from_resource(&seat).unwrap();
|
||||||
let mut shell = self.common.shell.write().unwrap();
|
let mut shell = self.common.shell.write().unwrap();
|
||||||
if let Some((grab, focus)) =
|
if let Some((grab, focus)) =
|
||||||
shell.resize_request(surface.wl_surface(), &seat, serial, edges.into())
|
shell.resize_request(surface.wl_surface(), &seat, serial, edges.into(), true)
|
||||||
{
|
{
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
|
||||||
|
|
@ -481,7 +481,7 @@ impl XwmHandler for State {
|
||||||
let mut shell = self.common.shell.write().unwrap();
|
let mut shell = self.common.shell.write().unwrap();
|
||||||
let seat = shell.seats.last_active().clone();
|
let seat = shell.seats.last_active().clone();
|
||||||
if let Some((grab, focus)) =
|
if let Some((grab, focus)) =
|
||||||
shell.resize_request(&wl_surface, &seat, None, resize_edge.into())
|
shell.resize_request(&wl_surface, &seat, None, resize_edge.into(), true)
|
||||||
{
|
{
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
@ -513,6 +513,7 @@ impl XwmHandler for State {
|
||||||
&self.common.config,
|
&self.common.config,
|
||||||
&self.common.event_loop_handle,
|
&self.common.event_loop_handle,
|
||||||
&self.common.xdg_activation_state,
|
&self.common.xdg_activation_state,
|
||||||
|
true,
|
||||||
) {
|
) {
|
||||||
std::mem::drop(shell);
|
std::mem::drop(shell);
|
||||||
if grab.is_touch_grab() {
|
if grab.is_touch_grab() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue