Skip to content

frames.c: add prototype, remove unused variable #473

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

Closed
wants to merge 1 commit into from

Conversation

brownsr
Copy link
Member

@brownsr brownsr commented Apr 10, 2019

No description provided.

@@ -28,6 +28,7 @@
#include <string.h>
#include <meta/boxes.h>
#include "frames.h"
#include "frame.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has implicit performance side effects. MetaFrame is passed as an argument in this file, like with

flags = meta_frame_get_flags (frame->meta_window->frame);

but we don't need to include its header unless we're accessing a property off its struct. Since frames.c is compiled much later, the function symbols are available. The structs primarily used here are MetaFrames and MetaUIFrame.

I don't understand why, but I tried this a while ago and it decreased performance. It might be an introspection quirk. Testing this patch, my previous experience was confirmed. Mutter doesn't include this header either, and it has the same meta_frame_* calls in frames.c.

Another way to solve this if it's causing a warning might be to just move the function definitions used in this file to window-private.h, which is included in frame.h.

@brownsr
Copy link
Member Author

brownsr commented Apr 11, 2019

OK, closing.

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

Successfully merging this pull request may close these issues.

3 participants