本文整理汇总了Golang中github.com/BurntSushi/xgbutil/xwindow.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: MakeDraggable
// drag around windows with the mouse.
func MakeDraggable(X *xgbutil.XUtil, win xproto.Window) {
// utility window for movement
xwin := xwindow.New(X, win)
// state
var offsetX, offsetY int
var lastX, lastY int
// saves initial click location
startDrag := func(X *xgbutil.XUtil, rootX, rootY, eventX, eventY int) (bool, xproto.Cursor) {
offsetX = eventX
offsetY = eventY
lastX = rootX
lastY = rootY
// apparently the cursor is just ID 0
return true, 0
}
// moves the window
stepDrag := func(X *xgbutil.XUtil, rootX, rootY, eventX, eventY int) {
// maintain mouse position within window
toX := rootX - offsetX
toY := rootY - offsetY
// move window
xwin.Move(toX, toY)
}
stopDrag := func(X *xgbutil.XUtil, rx, ry, ex, ey int) {}
// actually bind handler to window
mousebind.Drag(X, win, win, "1", true, startDrag, stepDrag, stopDrag)
log.Printf("MakeDraggable: activated window %v\n", xwin)
}
开发者ID:justjake,项目名称:j3,代码行数:34,代码来源:action.go
示例2: detachXid
func (app *RuntimeApp) detachXid(xid xproto.Window) {
if info, ok := app.xids[xid]; ok {
xwindow.New(XU, xid).Listen(xproto.EventMaskNoEvent)
xevent.Detach(XU, xid)
if len(app.xids) == 1 {
ENTRY_MANAGER.destroyRuntimeApp(app)
} else {
delete(app.xids, xid)
if info == app.CurrentInfo {
for _, nextInfo := range app.xids {
if nextInfo != nil {
app.CurrentInfo = nextInfo
app.updateState(app.CurrentInfo.Xid)
app.notifyChanged()
} else {
ENTRY_MANAGER.destroyRuntimeApp(app)
}
break
}
}
}
}
if len(app.xids) == 0 {
app.setChangedCB(nil)
} else {
app.notifyChanged()
}
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:29,代码来源:runtime_apps.go
示例3: Root
func Root() {
rwin := xwindow.New(X, X.RootWin())
for _, c := range Clients {
c.Unfocused()
}
rwin.Focus()
}
开发者ID:dlintw,项目名称:wingo,代码行数:7,代码来源:focus.go
示例4: addTrayIcon
func (m *TrayManager) addTrayIcon(xid xproto.Window) {
m.checkValid()
for _, id := range m.TrayIcons {
if xproto.Window(id) == xid {
return
}
}
if d, err := damage.NewDamageId(TrayXU.Conn()); err != nil {
return
} else {
m.dmageInfo[xid] = d
if err := damage.CreateChecked(TrayXU.Conn(), d, xproto.Drawable(xid), damage.ReportLevelRawRectangles).Check(); err != nil {
logger.Debug("DamageCreate Failed:", err)
return
}
}
composite.RedirectWindow(TrayXU.Conn(), xid, composite.RedirectAutomatic)
m.TrayIcons = append(m.TrayIcons, uint32(xid))
icon := xwindow.New(TrayXU, xid)
icon.Listen(xproto.EventMaskVisibilityChange | damage.Notify | xproto.EventMaskStructureNotify)
icon.Change(xproto.CwBackPixel, 0)
name, err := ewmh.WmNameGet(TrayXU, xid)
if err != nil {
logger.Debug("WmNameGet failed:", err, xid)
}
m.nameInfo[xid] = name
m.notifyInfo[xid] = true
dbus.Emit(m, "Added", uint32(xid))
logger.Infof("Added try icon: \"%s\"(%d)", name, uint32(xid))
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:33,代码来源:traymanager.go
示例5: isWindowOnPrimaryScreen
func isWindowOnPrimaryScreen(xid xproto.Window) bool {
var err error
win := xwindow.New(XU, xid)
// include shadow
gemo, err := win.DecorGeometry()
if err != nil {
logger.Debug(err)
return false
}
displayRectX := (int)(displayRect.X)
displayRectY := (int)(displayRect.Y)
displayRectWidth := (int)(displayRect.Width)
displayRectHeight := (int)(displayRect.Height)
SHADOW_OFFSET := 10
gemoX := gemo.X() + SHADOW_OFFSET
gemoY := gemo.Y() + SHADOW_OFFSET
isOnPrimary := gemoX+SHADOW_OFFSET >= displayRectX &&
gemoX < displayRectX+displayRectWidth &&
gemoY >= displayRectY &&
gemoY < displayRectY+displayRectHeight
logger.Debugf("isWindowOnPrimaryScreen: %dx%d, %dx%d, %v", gemo.X(),
gemo.Y(), displayRect.X, displayRect.Y, isOnPrimary)
return isOnPrimary
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:29,代码来源:client_manager.go
示例6: isWindowOverlapDock
func isWindowOverlapDock(xid xproto.Window) bool {
win := xwindow.New(XU, xid)
rect, err := win.DecorGeometry()
if err != nil {
logger.Warning(err)
return false
}
winX := int32(rect.X())
winY := int32(rect.Y())
winWidth := int32(rect.Width())
winHeight := int32(rect.Height())
dockX := int32(displayRect.X) + (int32(displayRect.Width)-
dockProperty.PanelWidth)/2
dockY := int32(displayRect.Y) + int32(displayRect.Height) -
dockProperty.Height
dockWidth := int32(displayRect.Width)
if DisplayModeType(setting.GetDisplayMode()) == DisplayModeModernMode {
dockWidth = dockProperty.PanelWidth
}
// TODO: dock on the other side like top, left.
return dockY < winY+winHeight &&
dockX < winX+winWidth && dockX+dockWidth > winX
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:26,代码来源:client_manager.go
示例7: createNotify
func createNotify(X *xgbutil.XUtil, event xgb.Event) {
ev := event.(xproto.CreateNotifyEvent)
// values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE;
// xcb_change_window_attributes(wm->conn, id, XCB_CW_EVENT_MASK, values);
win := xwindow.New(X, ev.Window)
win.Listen(xproto.EventMaskPropertyChange)
XWins[ev.Window] = &XWin{
surfaceId: 0,
}
}
开发者ID:fangyuanziti,项目名称:wayland-html,代码行数:11,代码来源:xwm.go
示例8: headGeom
func headGeom(X *xgbutil.XUtil) xrect.Rect {
if X.ExtInitialized("XINERAMA") {
heads, err := xinerama.PhysicalHeads(X)
if err == nil {
return heads[0]
}
}
geom, err := xwindow.New(X, X.RootWin()).Geometry()
fatal(err)
return geom
}
开发者ID:cshapeshifter,项目名称:wingo,代码行数:12,代码来源:main.go
示例9: currentTime
// currentTime forcefully causes a PropertyNotify event to fire on the root
// window, then scans the event queue and picks up the time.
//
// It is NOT SAFE to call this function in a place other than Wingo's
// initialization. Namely, this function subverts xevent's queue and reads
// events directly from X.
func currentTime(X *xgbutil.XUtil) (xproto.Timestamp, error) {
wmClassAtom, err := xprop.Atm(X, "WM_CLASS")
if err != nil {
return 0, err
}
stringAtom, err := xprop.Atm(X, "STRING")
if err != nil {
return 0, err
}
// Make sure we're listening to PropertyChange events on the root window.
err = xwindow.New(X, X.RootWin()).Listen(xproto.EventMaskPropertyChange)
if err != nil {
return 0, fmt.Errorf(
"Could not listen to Root window events (PropertyChange): %s", err)
}
// Do a zero-length append on a property as suggested by ICCCM 2.1.
err = xproto.ChangePropertyChecked(
X.Conn(), xproto.PropModeAppend, X.RootWin(),
wmClassAtom, stringAtom, 8, 0, nil).Check()
if err != nil {
return 0, err
}
// Now look for the PropertyNotify generated by that zero-length append
// and return the timestamp attached to that event.
// Note that we do this outside of xgbutil/xevent, since ownership
// is literally the first thing we do after connecting to X.
// (i.e., we don't have our event handling system initialized yet.)
timeout := time.After(3 * time.Second)
for {
select {
case <-timeout:
return 0, fmt.Errorf(
"Expected a PropertyNotify event to get a valid timestamp, " +
"but never received one.")
default:
ev, err := X.Conn().PollForEvent()
if err != nil {
continue
}
if propNotify, ok := ev.(xproto.PropertyNotifyEvent); ok {
X.TimeSet(propNotify.Time) // why not?
return propNotify.Time, nil
}
time.Sleep(100 * time.Millisecond)
}
}
panic("unreachable")
}
开发者ID:mkrull,项目名称:wingo,代码行数:58,代码来源:ownership.go
示例10: NewSocket
func NewSocket(X *xgbutil.XUtil, wid xproto.Window) (*XEmbedSocket, error) {
sock := &XEmbedSocket{
Window: xwindow.New(X, wid),
id: wid,
X: X,
}
if err := sock.load(); err != nil {
return nil, err
}
return sock, nil
}
开发者ID:AmandaCameron,项目名称:gobar,代码行数:13,代码来源:embedder.go
示例11: configureRequest
func configureRequest(X *xgbutil.XUtil, event xgb.Event) {
ev := event.(xproto.ConfigureRequestEvent)
win := xwindow.New(X, ev.Window)
win.Configure(
xproto.ConfigWindowX|
xproto.ConfigWindowY|
xproto.ConfigWindowWidth|
xproto.ConfigWindowHeight,
(int)(ev.X), (int)(ev.Y),
(int)(ev.Width), (int)(ev.Height),
ev.Sibling,
ev.StackMode,
)
log.Info("configure request:", ev)
}
开发者ID:fangyuanziti,项目名称:wayland-html,代码行数:16,代码来源:xwm.go
示例12: main
func main() {
X, err := xgbutil.NewConn()
if err != nil {
log.Fatal(err)
}
// Start generating other source events.
otherChan := otherSource()
// Start generating X events (by sending client messages to root window).
go xSource(X)
// Listen to those X events.
xwindow.New(X, X.RootWin()).Listen(xproto.EventMaskSubstructureNotify)
// Respond to those X events.
xevent.ClientMessageFun(
func(X *xgbutil.XUtil, ev xevent.ClientMessageEvent) {
atmName, err := xprop.AtomName(X, ev.Type)
if err != nil {
log.Fatal(err)
}
fmt.Printf("ClientMessage: %d. %s\n", ev.Data.Data32[0], atmName)
}).Connect(X, X.RootWin())
// Instead of using the usual xevent.Main, we use xevent.MainPing.
// It runs the main event loop inside a goroutine and returns ping
// channels, which are sent benign values right before an event is
// dequeued and right after that event has finished running all callbacks
// associated with it, respectively.
pingBefore, pingAfter, pingQuit := xevent.MainPing(X)
for {
select {
case <-pingBefore:
// Wait for the event to finish processing.
<-pingAfter
case otherVal := <-otherChan:
fmt.Printf("Processing other event: %d\n", otherVal)
case <-pingQuit:
fmt.Printf("xevent loop has quit")
return
}
}
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:44,代码来源:main.go
示例13: start
func (wa *fullScreenWorkaround) start() {
var runner func()
runner = func() {
w, _ := ewmh.ActiveWindowGet(wa.xu)
wa.detectTarget(w)
time.AfterFunc(time.Second*5, runner)
}
runner()
root := xwindow.New(wa.xu, wa.xu.RootWin())
root.Listen(xproto.EventMaskPropertyChange)
xevent.PropertyNotifyFun(func(XU *xgbutil.XUtil, ev xevent.PropertyNotifyEvent) {
if wa.activeWindowAtom == ev.Atom {
w, _ := ewmh.ActiveWindowGet(XU)
wa.detectTarget(w)
}
}).Connect(wa.xu, root.Id)
xevent.Main(wa.xu)
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:19,代码来源:workaround_fullscreen.go
示例14: main
func main() {
var err error
X, err = xgbutil.NewConn()
if err != nil {
log.Fatal(err)
}
clientids, err := ewmh.ClientListGet(X)
if err != nil {
log.Fatal(err)
}
for _, clientid := range clientids {
name, err := ewmh.WmNameGet(X, clientid)
if err != nil {
continue
}
if name == "Super Hexagon" {
HexWindow = xwindow.New(X, clientid)
break
}
}
if HexWindow == nil {
log.Fatal("Couldn't find Super Hexagon window.")
}
//Create a window
DisplayWindow, err = xwindow.Generate(X)
if err != nil {
log.Fatalf("Could not generate a new window X id: %s", err)
}
dgeom, _ := HexWindow.DecorGeometry()
DisplayWindow.Create(X.RootWin(), 0, 0, dgeom.Width(), dgeom.Height(), xproto.CwBackPixel, 0)
DisplayWindow.Map()
//Start the routine that updates the window
go updater()
xevent.Main(X)
}
开发者ID:xthexder,项目名称:superhexagon,代码行数:42,代码来源:superhexagon.go
示例15: getViewport
func getViewport() (geom string) {
// new X server connection
X, err := xgbutil.NewConn()
if err != nil {
log.Error(err)
}
// get root window
root := xwindow.New(X, X.RootWin())
// geometry of the root window
rgeom, err := root.Geometry()
if err != nil {
log.Error(err)
}
// Get the rectangles for each of the active physical heads.
// These are returned sorted in order from left to right and then top
// to bottom.
// But first check if Xinerama is enabled. If not, use root geometry.
var heads xinerama.Heads
if X.ExtInitialized("XINERAMA") {
heads, err = xinerama.PhysicalHeads(X)
if err != nil {
log.Error(err)
}
} else {
heads = xinerama.Heads{rgeom}
}
// looking for the first screen, position X: 0, Y: 0
for _, head := range heads {
if head.X() == 0 && head.Y() == 0 {
screenWidth = head.Width()
screenHeight = head.Height()
}
}
geom = fmt.Sprintf("%dx%d", screenWidth-165, screenHeight-165)
return geom
}
开发者ID:cabrel,项目名称:xfcm,代码行数:42,代码来源:xfcm.go
示例16: Initialize
func (l *Listener) Initialize() error {
if l.X == nil {
return fmt.Errorf("X must not be nil.")
}
if typeAtom == 0 && typeAtomBegin == 0 {
var err error
typeAtom, err = xprop.Atom(l.X, "_NET_STARTUP_INFO", false)
if err != nil {
return err
}
typeAtomBegin, err = xprop.Atom(l.X, "_NET_STARTUP_INFO_BEGIN", false)
if err != nil {
return err
}
}
if l.Callbacks == nil {
return fmt.Errorf("Callbacks must not be nil")
}
if err := xwindow.New(l.X, l.X.RootWin()).Listen(xproto.EventMaskPropertyChange); err != nil {
return err
}
l.msgBuff = make(map[xproto.Window][]byte)
xevent.HookFun(func(_ *xgbutil.XUtil, ev interface{}) bool {
return l.hook(ev)
}).Connect(l.X)
return nil
}
开发者ID:AmandaCameron,项目名称:gobar,代码行数:36,代码来源:listener.go
示例17: newClient
func newClient(X *xgbutil.XUtil, id xproto.Window) *client {
X.Grab()
defer X.Ungrab()
if client := wingo.findManagedClient(id); client != nil {
logger.Message.Printf("Already managing client: %s", client)
return nil
}
win := xwindow.New(X, id)
if _, err := win.Geometry(); err != nil {
logger.Warning.Printf("Could not manage client %d because: %s", id, err)
return nil
}
c := &client{
X: X,
win: win,
name: "N/A",
state: frame.Inactive,
layer: stack.LayerDefault,
maximized: false,
iconified: false,
unmapIgnore: 0,
floating: false,
}
c.manage()
if !c.iconified {
c.Map()
if c.primaryType == clientTypeNormal {
focus.Focus(c)
}
}
return c
}
开发者ID:dlintw,项目名称:wingo,代码行数:36,代码来源:client_manage.go
示例18: main
func main() {
if flagWriteConfig {
writeConfigFiles()
os.Exit(0)
}
X, err := xgbutil.NewConn()
if err != nil {
logger.Error.Println(err)
logger.Error.Fatalln("Error connecting to X, quitting...")
}
defer X.Conn().Close()
// Do this first! Attempt to retrieve window manager ownership.
// This includes waiting for any existing window manager to die.
// 'own' also sets up handlers for quitting when a window manager tries
// to replace *us*.
if err := own(X, flagReplace); err != nil {
logger.Error.Fatalf(
"Could not establish window manager ownership: %s", err)
}
if len(flagConfigDir) > 0 {
misc.ConfigPaths.Override = flagConfigDir
}
if len(flagDataDir) > 0 {
misc.DataPaths.Override = flagDataDir
}
misc.ReadData()
keybind.Initialize(X)
mousebind.Initialize(X)
focus.Initialize(X)
stack.Initialize(X)
cursors.Initialize(X)
wm.Initialize(X, commands.Env, newHacks())
hook.Initialize(commands.Env, misc.ConfigFile("hooks.wini"))
// Listen to Root. It is all-important.
err = xwindow.New(X, X.RootWin()).Listen(
xproto.EventMaskPropertyChange |
xproto.EventMaskFocusChange |
xproto.EventMaskButtonPress |
xproto.EventMaskButtonRelease |
xproto.EventMaskStructureNotify |
xproto.EventMaskSubstructureNotify |
xproto.EventMaskSubstructureRedirect)
if err != nil {
logger.Error.Fatalf("Could not listen to Root window events: %s", err)
}
// Update state when the root window changes size
wm.RootGeomChangeFun().Connect(X, wm.Root.Id)
// Oblige map request events
xevent.MapRequestFun(
func(X *xgbutil.XUtil, ev xevent.MapRequestEvent) {
xclient.New(ev.Window)
}).Connect(X, wm.Root.Id)
// Oblige configure requests from windows we don't manage.
xevent.ConfigureRequestFun(
func(X *xgbutil.XUtil, ev xevent.ConfigureRequestEvent) {
// Make sure we aren't managing this client.
if wm.FindManagedClient(ev.Window) != nil {
return
}
xwindow.New(X, ev.Window).Configure(int(ev.ValueMask),
int(ev.X), int(ev.Y), int(ev.Width), int(ev.Height),
ev.Sibling, ev.StackMode)
}).Connect(X, wm.Root.Id)
xevent.FocusInFun(
func(X *xgbutil.XUtil, ev xevent.FocusInEvent) {
if ignoreRootFocus(ev.Mode, ev.Detail) {
return
}
if len(wm.Workspace().Clients) == 0 {
return
}
wm.FocusFallback()
}).Connect(X, wm.Root.Id)
// Listen to Root client message events. This is how we handle all
// of the EWMH bullshit.
xevent.ClientMessageFun(handleClientMessages).Connect(X, wm.Root.Id)
// Tell everyone what we support.
setSupported()
// Start up the IPC command listener.
go ipc()
// Just before starting the main event loop, check to see if there are
// any clients that already exist that we should manage.
manageExistingClients()
// Now make sure that clients are in the appropriate visible state.
for _, wrk := range wm.Heads.Workspaces.Wrks {
//.........这里部分代码省略.........
开发者ID:Pursuit92,项目名称:wingo,代码行数:101,代码来源:main.go
示例19: rootInit
func rootInit(X *xgbutil.XUtil) {
var err error
// Listen to Root. It is all-important.
evMasks := xproto.EventMaskPropertyChange |
xproto.EventMaskFocusChange |
xproto.EventMaskButtonPress |
xproto.EventMaskButtonRelease |
xproto.EventMaskStructureNotify |
xproto.EventMaskSubstructureNotify |
xproto.EventMaskSubstructureRedirect
if wm.Config.FfmHead {
evMasks |= xproto.EventMaskPointerMotion
}
err = xwindow.New(X, X.RootWin()).Listen(evMasks)
if err != nil {
logger.Error.Fatalf("Could not listen to Root window events: %s", err)
}
// Update state when the root window changes size
wm.RootGeomChangeFun().Connect(X, wm.Root.Id)
// Oblige map request events
xevent.MapRequestFun(
func(X *xgbutil.XUtil, ev xevent.MapRequestEvent) {
xclient.New(ev.Window)
}).Connect(X, wm.Root.Id)
// Oblige configure requests from windows we don't manage.
xevent.ConfigureRequestFun(
func(X *xgbutil.XUtil, ev xevent.ConfigureRequestEvent) {
// Make sure we aren't managing this client.
if wm.FindManagedClient(ev.Window) != nil {
return
}
xwindow.New(X, ev.Window).Configure(int(ev.ValueMask),
int(ev.X), int(ev.Y), int(ev.Width), int(ev.Height),
ev.Sibling, ev.StackMode)
}).Connect(X, wm.Root.Id)
xevent.FocusInFun(
func(X *xgbutil.XUtil, ev xevent.FocusInEvent) {
if ignoreRootFocus(ev.Mode, ev.Detail) {
return
}
if len(wm.Workspace().Clients) == 0 {
return
}
wm.FocusFallback()
}).Connect(X, wm.Root.Id)
// Listen to Root client message events. This is how we handle all
// of the EWMH bullshit.
xevent.ClientMessageFun(handleClientMessages).Connect(X, wm.Root.Id)
// Check where the pointer is on motion events. If it's crossed a monitor
// boundary, switch the focus of the head.
if wm.Config.FfmHead {
xevent.MotionNotifyFun(handleMotionNotify).Connect(X, wm.Root.Id)
}
}
开发者ID:mkrull,项目名称:wingo,代码行数:62,代码来源:root.go
示例20: xwmInit
func xwmInit(fd uintptr) {
X := fromFd(fd)
defer X.Conn().Close()
root := xwindow.New(X, X.RootWin())
if _, err := root.Geometry(); err != nil {
panic(err)
}
// if names, _ := ewmh.DesktopNamesGet(X); len(names) > 0 {
// println(names)
// }
composite.Init(X.Conn())
atomNames := []string{
"WL_SURFACE_ID",
"WM_DELETE_WINDOW",
"WM_PROTOCOLS",
"WM_S0",
"WM_NORMAL_HINTS",
"WM_TAKE_FOCUS",
"WM_STATE",
"WM_CLIENT_MACHINE",
"_NET_WM_CM_S0",
"_NET_WM_NAME",
"_NET_WM_PID",
"_NET_WM_ICON",
"_NET_WM_STATE",
"_NET_WM_STATE_FULLSCREEN",
"_NET_WM_USER_TIME",
"_NET_WM_ICON_NAME",
"_NET_WM_WINDOW_TYPE",
"_NET_WM_WINDOW_TYPE_DESKTOP",
"_NET_WM_WINDOW_TYPE_DOCK",
"_NET_WM_WINDOW_TYPE_TOOLBAR",
"_NET_WM_WINDOW_TYPE_MENU",
"_NET_WM_WINDOW_TYPE_UTILITY",
"_NET_WM_WINDOW_TYPE_SPLASH",
"_NET_WM_WINDOW_TYPE_DIALOG",
"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
"_NET_WM_WINDOW_TYPE_POPUP_MENU",
"_NET_WM_WINDOW_TYPE_TOOLTIP",
"_NET_WM_WINDOW_TYPE_NOTIFICATION",
"_NET_WM_WINDOW_TYPE_COMBO",
"_NET_WM_WINDOW_TYPE_DND",
"_NET_WM_WINDOW_TYPE_NORMAL",
"_NET_WM_MOVERESIZE",
"_NET_SUPPORTING_WM_CHECK",
"_NET_SUPPORTED",
"_MOTIF_WM_HINTS",
"CLIPBOARD",
"CLIPBOARD_MANAGER",
"TARGETS",
"UTF8_STRING",
"_WL_SELECTION",
"INCR",
"TIMESTAMP",
"MULTIPLE",
"UTF8_STRING",
"COMPOUND_TEXT",
"TEXT",
"STRING",
"text/plain;charset=utf-8",
"text/plain",
"XdndSelection",
"XdndAware",
"XdndEnter",
"XdndLeave",
"XdndDrop",
"XdndStatus",
"XdndFinished",
"XdndTypeList",
"XdndActionCopy",
}
cookies := make([]xproto.InternAtomCookie, len(atomNames))
for i := 0; i < len(atomNames); i++ {
cookies[i] = xproto.InternAtom(X.Conn(),
false, uint16(len(atomNames[i])), atomNames[i])
}
/* Try to select for substructure redirect. */
evMasks := xproto.EventMaskPropertyChange |
xproto.EventMaskFocusChange |
xproto.EventMaskButtonPress |
xproto.EventMaskButtonRelease |
xproto.EventMaskStructureNotify |
xproto.EventMaskSubstructureNotify |
xproto.EventMaskSubstructureRedirect
root.Listen(evMasks)
composite.RedirectSubwindows(X.Conn(), root.Id,
composite.RedirectManual)
// change config
//.........这里部分代码省略.........
开发者ID:fangyuanziti,项目名称:wayland-html,代码行数:101,代码来源:xwm.go
注:本文中的github.com/BurntSushi/xgbutil/xwindow.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论