-
Notifications
You must be signed in to change notification settings - Fork 23
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
Switch to wlr scene-graph #50
Merged
+704
−1,274
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
398e0f1
output: While destroying, destroy layers
7c98b5e
Remove API that relies on our rendering
8c191d2
Introduce kiwmi_strata
f144eb1
Keep an up-to-date wlr scene-graph
670b63b
Render using wlr_scene
b82e612
Prefer wlr_scene as the source of truth
a8a8282
Move popup unconstraining logic
ac0f6b7
Cleanup unneeded code after switching to wlr_scene
8dcfffb
Support protocols made easy by wlr_scene
37312b9
(Un)focus logic improvements
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Copyright (c), Niclas Meyer <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef KIWMI_DESKTOP_DESKTOP_SURFACE_H | ||
#define KIWMI_DESKTOP_DESKTOP_SURFACE_H | ||
|
||
struct wlr_surface; | ||
struct kiwmi_desktop; | ||
|
||
enum kiwmi_desktop_surface_type { | ||
KIWMI_DESKTOP_SURFACE_VIEW, | ||
KIWMI_DESKTOP_SURFACE_LAYER, | ||
}; | ||
|
||
struct kiwmi_desktop_surface { | ||
// The tree is where the config is supposed to put custom decorations (it | ||
// also contains the surface_node) | ||
struct wlr_scene_tree *tree; | ||
struct wlr_scene_node *surface_node; | ||
|
||
struct wlr_scene_tree *popups_tree; | ||
|
||
enum kiwmi_desktop_surface_type type; | ||
const struct kiwmi_desktop_surface_impl *impl; | ||
}; | ||
|
||
struct kiwmi_desktop_surface_impl { | ||
struct kiwmi_output *(*get_output)( | ||
struct kiwmi_desktop_surface *desktop_surface); | ||
}; | ||
|
||
struct kiwmi_desktop_surface * | ||
desktop_surface_at(struct kiwmi_desktop *desktop, double lx, double ly); | ||
struct kiwmi_output * | ||
desktop_surface_get_output(struct kiwmi_desktop_surface *desktop_surface); | ||
void desktop_surface_get_pos( | ||
struct kiwmi_desktop_surface *desktop_surface, | ||
int *lx, | ||
int *ly); | ||
|
||
#endif /* KIWMI_DESKTOP_DESKTOP_SURFACE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* Copyright (c), Niclas Meyer <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef KIWMI_DESKTOP_POPUP_H | ||
#define KIWMI_DESKTOP_POPUP_H | ||
|
||
struct wlr_xdg_popup; | ||
struct kiwmi_desktop_surface; | ||
|
||
struct kiwmi_desktop_surface * | ||
popup_get_desktop_surface(struct wlr_xdg_popup *popup); | ||
void popup_attach( | ||
struct wlr_xdg_popup *popup, | ||
struct kiwmi_desktop_surface *desktop_surface); | ||
|
||
#endif /* KIWMI_DESKTOP_POPUP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* Copyright (c), Niclas Meyer <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef KIWMI_DESKTOP_STRATUM_H | ||
#define KIWMI_DESKTOP_STRATUM_H | ||
|
||
#include <stdint.h> | ||
|
||
/** | ||
* A stratum is a layer in the scene-graph (the name was chosen to avoid | ||
* confusion with layer-shell). The root node contains a scene_tree for each | ||
* stratum, which itself contains a scene_tree per output. | ||
*/ | ||
|
||
// There are some assumptions made about the values, don't mindlessly change. | ||
enum kiwmi_stratum { | ||
KIWMI_STRATUM_LS_BACKGROUND, // LS == layer_shell | ||
KIWMI_STRATUM_LS_BOTTOM, | ||
KIWMI_STRATUM_NORMAL, | ||
KIWMI_STRATUM_LS_TOP, | ||
KIWMI_STRATUM_LS_OVERLAY, | ||
KIWMI_STRATUM_POPUPS, | ||
KIWMI_STRATA_COUNT, | ||
KIWMI_STRATUM_NONE = KIWMI_STRATA_COUNT, | ||
}; | ||
|
||
enum kiwmi_stratum stratum_from_layer_shell_layer(uint32_t layer); | ||
|
||
#endif /* KIWMI_DESKTOP_STRATUM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other compositors have top, normal popups, fulscreen, overlay, overlay popups, but since kiwmi doesn’t support client-initiated fulscreen, i left it like this.
(This is just a note for later ig.)