-
Notifications
You must be signed in to change notification settings - Fork 278
xwayland: add server and basic window functionality #10
xwayland: add server and basic window functionality #10
Conversation
struct wl_listener map; | ||
struct wl_listener unmap; | ||
struct wl_listener destroy; | ||
struct wlr_box geom; /* layout-relative, includes border */ | ||
int isxdg; |
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.
This could become an enum, when we add layer shell.
title = broken; | ||
} else { | ||
if (!(title = c->xwayland_surface->title)) | ||
title = broken; |
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.
xwayland does not have an app_id
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.
It does appear to still have instance/class though
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.
It does appear to still have instance/class though
We can add those when we use them e.g. rules based on class.
else | ||
surface = wlr_surface_surface_at(c->xwayland_surface->surface, | ||
cursor->x - c->geom.x - c->bw, | ||
cursor->y - c->geom.y - c->bw, NULL, NULL); |
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.
Cases like these intentionally invoke different methods, as the xdg version has more functionality.
@@ -1550,6 +1643,7 @@ main(int argc, char *argv[]) | |||
run(startup_cmd); | |||
|
|||
/* Once wl_display_run returns, we shut down the server. */ | |||
wlr_xwayland_destroy(xwayland); |
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.
This is null safe.
union { | ||
struct wlr_xdg_surface *xdg_surface; | ||
struct wlr_xwayland_surface *xwayland_surface; | ||
}; |
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.
The anonymous-union-and-a-boolean seemed the simplest approach, and sway is using it.
Happy to change if anything better is suggested.
dwl.c
Outdated
surface = c->xdg_surface->surface; | ||
if (c && !surface) { | ||
surface = WLR_SURFACE(c); | ||
} |
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.
It looks like this repo prefers to omit braces when an if contains a single statement. This change does not match that style.
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.
Fixed; thanks for spotting it.
Thanks for getting back to the review! It looks like your commits are all the same message. I'm not sure what the policy is for this repo (note that they may prefer you not rebase/force push more than they care about commit messages), but I encourage commit messages that describe what's going on in the commit. Something like "Remove braces from single-statement if" is what I would write for that last commit. |
/nudge @djpohly |
Thanks @alex-courtis for the work! Sorry I couldn't get to major dwl stuff until now (teaching + research + pandemic = crazy), but this looks like a great starting point for XWayland. |
No worries. More xwayland PRs incoming. |
dwl: Great News
So happy to find this project! I'm a massive dwm fan, who knows it is soon time to move to wayland.
Using the mature wlroots is the right thing to do, even if it's not quite suckless. I even started such a project, but never followed through: https://github.com/alex-courtis/wdwm
I am hopeful that the preserved structure of dwl will result in many dwm patches still applying, or applying with little change.
Happy to help in any way I can, so I picked a task off the feature list in the readme.
cheers,
Alex
XWayland
These changes add the X server and dwl functionality for basic X clients. It's been tested with st, chromium and intellij, at scale 1 and 2.
I don't know your preferences: merge incrementally or keep a long running branch until feature complete. This PR is here, you can decide.
Next:
Remaining functionality will be added at the same time dwl implements e.g. fullscreen