mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
Merge pull request #176 from mitchellh/mrn/gtk-fullscreen
gtk: handle ctrl+return to toggle fullscreen
This commit is contained in:
@ -459,6 +459,16 @@ const Window = struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Toggle fullscreen for this window.
|
||||||
|
fn toggleFullscreen(self: *Window) void {
|
||||||
|
const is_fullscreen = c.gtk_window_is_fullscreen(self.window);
|
||||||
|
if (is_fullscreen == 0) {
|
||||||
|
c.gtk_window_fullscreen(self.window);
|
||||||
|
} else {
|
||||||
|
c.gtk_window_unfullscreen(self.window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Grabs focus on the currently selected tab.
|
/// Grabs focus on the currently selected tab.
|
||||||
fn focusCurrentTab(self: *Window) void {
|
fn focusCurrentTab(self: *Window) void {
|
||||||
const page_idx = c.gtk_notebook_get_current_page(self.notebook);
|
const page_idx = c.gtk_notebook_get_current_page(self.notebook);
|
||||||
@ -795,6 +805,10 @@ pub const Surface = struct {
|
|||||||
c.gtk_widget_show(alert);
|
c.gtk_widget_show(alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn toggleFullscreen(self: *Surface) void {
|
||||||
|
self.window.toggleFullscreen();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn newTab(self: *Surface) !void {
|
pub fn newTab(self: *Surface) !void {
|
||||||
try self.window.newTab();
|
try self.window.newTab();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user