Skip to content

Commit

Permalink
Merge pull request #1192 from chrisduerr/mandatory_reposition
Browse files Browse the repository at this point in the history
Make XdgShellHandler::reposition_request mandatory
  • Loading branch information
Drakulix authored Nov 1, 2023
2 parents dfe8bfb + 4f7dbda commit b9518a9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions examples/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ impl XdgShellHandler for App {
fn grab(&mut self, _surface: PopupSurface, _seat: wl_seat::WlSeat, _serial: Serial) {
// Handle popup grab here
}

fn reposition_request(&mut self, _surface: PopupSurface, _positioner: PositionerState, _token: u32) {
// Handle popup reposition here
}
}

impl SelectionHandler for App {
Expand Down
6 changes: 6 additions & 0 deletions src/wayland/shell/xdg/decoration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
//! # seat: wl_seat::WlSeat,
//! # serial: Serial,
//! # ) { unimplemented!() }
//! # fn reposition_request(
//! # &mut self,
//! # surface: PopupSurface,
//! # positioner: PositionerState,
//! # token: u32,
//! # ) { unimplemented!() }
//! // ...
//! }
//! impl XdgDecorationHandler for State {
Expand Down
16 changes: 13 additions & 3 deletions src/wayland/shell/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
//! ) {
//! // ...
//! }
//! fn reposition_request(
//! &mut self,
//! surface: PopupSurface,
//! positioner: PositionerState,
//! token: u32,
//! ) {
//! // ...
//! }
//! }
//! delegate_xdg_shell!(State);
//!
Expand Down Expand Up @@ -930,8 +938,10 @@ pub trait XdgShellHandler {
/// A surface has acknowledged a configure serial.
fn ack_configure(&mut self, surface: wl_surface::WlSurface, configure: Configure) {}

/// A client requested a reposition, providing a new
/// positioner, of a popup.
/// A client requested a reposition, providing a new positioner for a popup.
///
/// To confirm the new popup position, `PopupSurface::send_repositioned` must be
/// called on the provided surface with the token.
///
/// ## Arguments
///
Expand All @@ -944,7 +954,7 @@ pub trait XdgShellHandler {
/// The new popup position will not take effect until the corresponding configure event
/// is acknowledged by the client. See xdg_popup.repositioned for details.
/// The token itself is opaque, and has no other special meaning.
fn reposition_request(&mut self, surface: PopupSurface, positioner: PositionerState, token: u32) {}
fn reposition_request(&mut self, surface: PopupSurface, positioner: PositionerState, token: u32);

/// A toplevel surface was destroyed.
fn toplevel_destroyed(&mut self, surface: ToplevelSurface) {}
Expand Down

0 comments on commit b9518a9

Please sign in to comment.