forked from gotk3/gotk3
-
Notifications
You must be signed in to change notification settings - Fork 3
/
screen_x11.go
32 lines (26 loc) · 1.2 KB
/
screen_x11.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//go:build (linux || freebsd) && !no_x11
// +build linux freebsd
// +build !no_x11
package gdk
// #cgo pkg-config: gdk-x11-3.0
// #include <gdk/gdk.h>
// #include <gdk/gdkx.h>
import "C"
func WorkspaceControlSupported() bool {
return true
}
// GetScreenNumber is a wrapper around gdk_x11_screen_get_screen_number().
// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false
func (v *Screen) GetScreenNumber() int {
return int(C.gdk_x11_screen_get_screen_number(v.native()))
}
// GetNumberOfDesktops is a wrapper around gdk_x11_screen_get_number_of_desktops().
// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false
func (v *Screen) GetNumberOfDesktops() uint32 {
return uint32(C.gdk_x11_screen_get_number_of_desktops(v.native()))
}
// GetCurrentDesktop is a wrapper around gdk_x11_screen_get_current_desktop().
// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false
func (v *Screen) GetCurrentDesktop() uint32 {
return uint32(C.gdk_x11_screen_get_current_desktop(v.native()))
}