After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779436 - ui/frames: Simplify client area control computation
ui/frames: Simplify client area control computation
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-01 19:39 UTC by Rui Matos
Modified: 2017-03-02 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ui/frames: Simplify client area control computation (2.48 KB, patch)
2017-03-01 19:39 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2017-03-01 19:39:01 UTC
Ungrabbed pointer motion events over a client window area don't even
reach mutter in X compositor mode, but as a wayland compositor we
process those events which ends up in a call stack like:

- meta_window_handle_ungrabbed_event
 - meta_ui_frame_handle_event
  - handle_motion_notify_event
   - get_control
    - meta_ui_frame_calc_geometry

Computing frame geometry is a relatively CPU expensive operation and
doing it on every motion event over a client window is pointless work
since we aren't going to change the cursor or prelight any frame
widget.

This commit special cases the determination of
META_FRAME_CONTROL_CLIENT_AREA using a much faster method. When
continuously moving the pointer over an X (client) window, it results
in a ~40% decrease in mutter cpu usage.
Comment 1 Rui Matos 2017-03-01 19:39:05 UTC
Created attachment 346993 [details] [review]
ui/frames: Simplify client area control computation
Comment 2 Florian Müllner 2017-03-01 19:49:01 UTC
Review of attachment 346993 [details] [review]:

Makes sense to me
Comment 3 Rui Matos 2017-03-02 18:42:04 UTC
Attachment 346993 [details] pushed as 1f20e82 - ui/frames: Simplify client area control computation