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) {
|
||||
if let Some((geometry, offset)) = seat.cursor_geometry(
|
||||
position.as_logical().to_buffer(
|
||||
output.current_scale().fractional_scale(),
|
||||
output.current_transform(),
|
||||
&output_geometry.size.to_f64().as_logical(),
|
||||
),
|
||||
(position - output_geometry.loc.to_f64())
|
||||
.as_logical()
|
||||
.to_buffer(
|
||||
output.current_scale().fractional_scale(),
|
||||
output.current_transform(),
|
||||
&output_geometry.size.to_f64().as_logical(),
|
||||
),
|
||||
self.common.clock.now(),
|
||||
) {
|
||||
if session
|
||||
|
|
@ -676,11 +678,11 @@ impl State {
|
|||
self.common.idle_notifier_state.notify_activity(&seat);
|
||||
notify_cursor_activity(self, &seat);
|
||||
let output = seat.active_output();
|
||||
let geometry = output.geometry();
|
||||
let position = geometry.loc.to_f64()
|
||||
let output_geometry = output.geometry();
|
||||
let position = output_geometry.loc.to_f64()
|
||||
+ smithay::backend::input::AbsolutePositionEvent::position_transformed(
|
||||
&event,
|
||||
geometry.size.as_logical(),
|
||||
output_geometry.size.as_logical(),
|
||||
)
|
||||
.as_global();
|
||||
let serial = SERIAL_COUNTER.next_serial();
|
||||
|
|
@ -702,11 +704,13 @@ impl State {
|
|||
let shell = self.common.shell.read();
|
||||
for session in cursor_sessions_for_output(&shell, &output) {
|
||||
if let Some((geometry, offset)) = seat.cursor_geometry(
|
||||
position.as_logical().to_buffer(
|
||||
output.current_scale().fractional_scale(),
|
||||
output.current_transform(),
|
||||
&geometry.size.to_f64().as_logical(),
|
||||
),
|
||||
(position - output_geometry.loc.to_f64())
|
||||
.as_logical()
|
||||
.to_buffer(
|
||||
output.current_scale().fractional_scale(),
|
||||
output.current_transform(),
|
||||
&output_geometry.size.to_f64().as_logical(),
|
||||
),
|
||||
self.common.clock.now(),
|
||||
) {
|
||||
if session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue