Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
wayland
wayland
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 97
    • Issues 97
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 30
    • Merge Requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wayland
  • waylandwayland
  • Issues
  • #193

Closed
Open
Created Feb 10, 2021 by Simon Ser@emersionOwner

Prevent wl_surface.attach abuse

wl_surface.attach can be abused to arbitrarily move a surface on screen. Can we prevent this?

To answer this question, let's ask ourselves another question: what are the use-cases for wl_surface.attach? It's used for client-side resizes, but how?

Toplevel gravity

Some clients have a toolbar on the left and on the right, e.g.:

screenshot

These toolbars can be toggled. It may be desirable to keep the work area (image editing area in the center) at the same position on screen when toggling a toolbar.

The client can just resize the buffer when toggling the toolbar on the right. But toggling the toolbar on the left requires compensating the position for the new buffer size.

In this use-case, dx = old_width - new_width.

Centered resize

If the client decides to resize itself on its own but wants to stay centered (e.g. for a dialog), then it might want to set dx = (old_width - new_width) / 2.

Conclusion

The compositor can't distinguish between legitimate uses and abuse.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None