Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only process surface configure if size has changed #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gartnera
Copy link

@gartnera gartnera commented Feb 13, 2022

I'm not sure why we're getting multiple layer_surface_configure callbacks in the first place, but this change ensures that we only respond to them if the surface size has actually changed.

This seems to fix #223 but I'm not exactly sure why.

I would also add this logic to ext_session_lock_surface_v1_handle_configure but I couldn't figure out how to get that protocol enabled for testing.

Before:

➜  swaylock-dpms-git git:(master) ✗ ninja -C build && ./build/swaylock --indicator-idle-visible
ninja: Entering directory `build'
[2/2] Linking target swaylock
layer_surface_configure: 22600, 1706, 960
layer_surface_configure done: 22600
layer_surface_configure: 22602, 1706, 960
layer_surface_configure done: 22602
layer_surface_configure: 22604, 1706, 960
layer_surface_configure done: 22604
layer_surface_configure: 22606, 1706, 960
layer_surface_configure done: 22606
layer_surface_configure: 22608, 1706, 960
layer_surface_configure done: 22608
layer_surface_configure: 22613, 1706, 960
layer_surface_configure done: 22613
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done

After:

➜  swaylock-dpms-git git:(master) ✗ ninja -C build && ./build/swaylock --indicator-idle-visible -s solid_color
ninja: Entering directory `build'
[2/2] Linking target swaylock
layer_surface_configure: 23098, 1706, 960
layer_surface_configure done: 23098
layer_surface_configure: 23100, 1706, 960
layer_surface_configure: 23102, 1706, 960
layer_surface_configure done: 23102
layer_surface_configure: 23104, 1706, 960
layer_surface_configure: 23106, 1706, 960
layer_surface_configure: 23111, 1706, 960
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done
surface_handle_frame_done

@gartnera gartnera changed the title Only process surface changes if size has changed Only process surface configure if size has changed Feb 13, 2022
@primalmotion
Copy link

I confirm that this patch fixes the flicker for me

@emersion
Copy link
Member

This is incorrect, we always need to ack_configure even if the size didn't change per the protocol spec.

@gartnera
Copy link
Author

This is incorrect, we always need to ack_configure even if the size didn't change per the protocol spec.

Sorry, I'm not exactly sure what I'm doing. This excerpt from the zwlr_layer_surface_v1_ack_configure doc string seemed to indicate that we didn't have to ack unless we actually do something:

When a configure event is received, if a client commits the
surface in response to the configure event, then the client
must make an ack_configure request sometime before the commit
request, passing along the serial of the configure event.

@primalmotion
Copy link

without this patch, swaylock just hangs after the circle hiccup now in master for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ring flickers during first input
3 participants