image-copy: Subtract output position for pointer position sent to client
This commit is contained in:
parent
b6b76e1d4a
commit
4a8931896f
1 changed files with 17 additions and 13 deletions
|
|
@ -640,11 +640,13 @@ impl State {
|
||||||
|
|
||||||
for session in cursor_sessions_for_output(&shell, &output) {
|
for session in cursor_sessions_for_output(&shell, &output) {
|
||||||
if let Some((geometry, offset)) = seat.cursor_geometry(
|
if let Some((geometry, offset)) = seat.cursor_geometry(
|
||||||
position.as_logical().to_buffer(
|
(position - output_geometry.loc.to_f64())
|
||||||
output.current_scale().fractional_scale(),
|
.as_logical()
|
||||||
output.current_transform(),
|
.to_buffer(
|
||||||
&output_geometry.size.to_f64().as_logical(),
|
output.current_scale().fractional_scale(),
|
||||||
),
|
output.current_transform(),
|
||||||
|
&output_geometry.size.to_f64().as_logical(),
|
||||||
|
),
|
||||||
self.common.clock.now(),
|
self.common.clock.now(),
|
||||||
) {
|
) {
|
||||||
if session
|
if session
|
||||||
|
|
@ -676,11 +678,11 @@ impl State {
|
||||||
self.common.idle_notifier_state.notify_activity(&seat);
|
self.common.idle_notifier_state.notify_activity(&seat);
|
||||||
notify_cursor_activity(self, &seat);
|
notify_cursor_activity(self, &seat);
|
||||||
let output = seat.active_output();
|
let output = seat.active_output();
|
||||||
let geometry = output.geometry();
|
let output_geometry = output.geometry();
|
||||||
let position = geometry.loc.to_f64()
|
let position = output_geometry.loc.to_f64()
|
||||||
+ smithay::backend::input::AbsolutePositionEvent::position_transformed(
|
+ smithay::backend::input::AbsolutePositionEvent::position_transformed(
|
||||||
&event,
|
&event,
|
||||||
geometry.size.as_logical(),
|
output_geometry.size.as_logical(),
|
||||||
)
|
)
|
||||||
.as_global();
|
.as_global();
|
||||||
let serial = SERIAL_COUNTER.next_serial();
|
let serial = SERIAL_COUNTER.next_serial();
|
||||||
|
|
@ -702,11 +704,13 @@ impl State {
|
||||||
let shell = self.common.shell.read();
|
let shell = self.common.shell.read();
|
||||||
for session in cursor_sessions_for_output(&shell, &output) {
|
for session in cursor_sessions_for_output(&shell, &output) {
|
||||||
if let Some((geometry, offset)) = seat.cursor_geometry(
|
if let Some((geometry, offset)) = seat.cursor_geometry(
|
||||||
position.as_logical().to_buffer(
|
(position - output_geometry.loc.to_f64())
|
||||||
output.current_scale().fractional_scale(),
|
.as_logical()
|
||||||
output.current_transform(),
|
.to_buffer(
|
||||||
&geometry.size.to_f64().as_logical(),
|
output.current_scale().fractional_scale(),
|
||||||
),
|
output.current_transform(),
|
||||||
|
&output_geometry.size.to_f64().as_logical(),
|
||||||
|
),
|
||||||
self.common.clock.now(),
|
self.common.clock.now(),
|
||||||
) {
|
) {
|
||||||
if session
|
if session
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue