wayland: only consider current output mode
This commit is contained in:
@@ -19,15 +19,15 @@ use smithay_client_toolkit::reexports::{
|
|||||||
|
|
||||||
pub use wayland_client;
|
pub use wayland_client;
|
||||||
use wayland_client::{
|
use wayland_client::{
|
||||||
|
Connection, Dispatch, EventQueue, Proxy, QueueHandle,
|
||||||
backend::WaylandError,
|
backend::WaylandError,
|
||||||
globals::{registry_queue_init, GlobalList, GlobalListContents},
|
globals::{GlobalList, GlobalListContents, registry_queue_init},
|
||||||
protocol::{
|
protocol::{
|
||||||
wl_output::{self, Transform, WlOutput},
|
wl_output::{self, Transform, WlOutput},
|
||||||
wl_registry::{self, WlRegistry},
|
wl_registry::{self, WlRegistry},
|
||||||
wl_seat::WlSeat,
|
wl_seat::WlSeat,
|
||||||
wl_shm::WlShm,
|
wl_shm::WlShm,
|
||||||
},
|
},
|
||||||
Connection, Dispatch, EventQueue, Proxy, QueueHandle,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub enum OutputChangeEvent {
|
pub enum OutputChangeEvent {
|
||||||
@@ -291,7 +291,20 @@ impl Dispatch<WlOutput, u32> for WlxClient {
|
|||||||
_qhandle: &QueueHandle<Self>,
|
_qhandle: &QueueHandle<Self>,
|
||||||
) {
|
) {
|
||||||
match event {
|
match event {
|
||||||
wl_output::Event::Mode { width, height, .. } => {
|
wl_output::Event::Mode {
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
flags,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
if !flags
|
||||||
|
.into_result()
|
||||||
|
.is_ok_and(|f| f.intersects(wl_output::Mode::Current))
|
||||||
|
{
|
||||||
|
// https://github.com/galister/wlx-capture/issues/5
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(output) = state.outputs.get_mut(*data) {
|
if let Some(output) = state.outputs.get_mut(*data) {
|
||||||
output.size = (width, height);
|
output.size = (width, height);
|
||||||
if output.done {
|
if output.done {
|
||||||
|
|||||||
Reference in New Issue
Block a user