-
Notifications
You must be signed in to change notification settings - Fork 0
fix a whole bunch of output problems #49
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
Changes from 13 commits
5183deb
53b379f
908d0b4
113827a
6bd3f35
ca6e5b8
dff98ea
8bff29d
2ae0f17
506d4dd
3f1134e
6066a5b
c0f887a
7b1364e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,10 +169,6 @@ pub fn focusSurface(self: *Seat, to_focus: ?FocusData) void { | |
| } | ||
|
|
||
| pub fn focusOutput(self: *Seat, output: *Output) void { | ||
| if (self.focused_output) |prev_output| { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like not having to set the state of individual outputs, good stuff |
||
| prev_output.focused = false; | ||
| } | ||
|
|
||
| self.focused_output = output; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,8 +286,30 @@ fn handleNewInput(listener: *wl.Listener(*wlr.InputDevice), device: *wlr.InputDe | |
| }); | ||
| } | ||
|
|
||
| fn handleNewOutput(_: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) void { | ||
| _ = Output.init(wlr_output); | ||
| fn handleNewOutput(listener: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) void { | ||
| const self: *Server = @fieldParentPtr("new_output", listener); | ||
| const output = Output.init(wlr_output) orelse { | ||
| std.log.err("Failed to create new output", .{}); | ||
| return; | ||
| }; | ||
|
|
||
| // TODO: Allow user to define output positions | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps to do this we could use an autocommand that simply returns the output's position? Just a though, no need to do this to merge |
||
| const layout_output = self.root.output_layout.addAuto(output.wlr_output) catch { | ||
| std.log.err("failed to add output to the output layout", .{}); | ||
| return; | ||
| }; | ||
|
|
||
| output.scene_output.setPosition(layout_output.x, layout_output.y); | ||
|
|
||
| // FIXME: without this the lua api can crash mez very easily. Thankfully we | ||
| // don't have a case for not having any output selected, but it'd still be | ||
| // better if we didn't crash. | ||
| if (self.getDefaultSeat().focused_output == null) { | ||
| self.getDefaultSeat().focusOutput(output); | ||
| } | ||
|
|
||
| Root.configureOutputs(&self.root); | ||
| output.arrangeLayers(); | ||
| } | ||
|
|
||
| fn handleNewXdgToplevel(_: *wl.Listener(*wlr.XdgToplevel), xdg_toplevel: *wlr.XdgToplevel) void { | ||
|
|
||
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.
Wouldn't this mean that a layer surface is currently a child of the wrong output and this is an incorrect state? Perhaps fix it or error?
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.
Maybe, I think we need to do some testing to figure out what would be best. I'll add a todo to the codebase.