简体   繁体   English

如何更改xmonad父母的窗口?

[英]How can I change the window xmonad reparents from?

I have a small application listed below which simply makes an x window and a small window inside of it. 我在下面列出了一个小应用程序,它只是在其中创建了一个x窗口和一个小窗口。 I later plan to make an experimental IDE where all the toolbars and menus are subwindows and one can choose whatever window manager one wants to manage them. 我后来计划制作一个实验性IDE,其中所有工具栏和菜单都是子窗口,并且可以选择要管理它们的任何窗口管理器。

What I would like to do is startup an xmonad instance and make it not reparent and control windows from the root window but to reparent and control windows inside my application's window. 我想做的是启动一个xmonad实例,并使其不从根窗口重现并控制窗口,而是在我的应用程序窗口中重定并控制窗口。

Is this possible? 这可能吗?

PS Here's the app. PS这是应用程序。

module Main where
import Graphics.X11.Xlib

y f = w where w = f w

main = do
 display <- openDisplay ""

 let screen = defaultScreen display

 root <- rootWindow display screen
 mainWindow <- createSimpleWindow
 display 
 root 
 0 0 100 100
 1
 (blackPixel display screen)
 (whitePixel display screen)
 setTextProperty display mainWindow "Subwindows" wM_NAME

 subWindow <- createSimpleWindow
  display 
  mainWindow
  0 0 100 100
  1
  (whitePixel display screen)
  (blackPixel display screen)
  mapWindow display subWindow

  mapWindow display mainWindow

  y $ \loop -> allocaXEvent $ \eventPointer -> do
   nextEvent display eventPointer
   event <- get_EventType eventPointer
   case () of
   _ | event == expose -> loop
     | otherwise -> return ()

In principle "just" a matter of replacing all hardcoded root window references in xmonad with a window ID that could be specified on startup. 原则上,只需将xmonad中所有硬编码的根窗口引用替换为可以在启动时指定的窗口ID即可。 But unless xmonad already has that feature, you'd surely have to hack on the xmonad code to add it. 但是,除非xmonad已经具有该功能,否则您肯定必须破解xmonad代码才能添加它。

You could run your whole own X server and pretend your window is a root window - like Xephyr or Xnest. 您可以运行自己的整个X服务器,并假装您的窗口是根窗口,例如Xephyr或Xnes​​t。 That's surely much harder than adding the xmonad feature to use a non-root window, but it has the advantage that it would work with any window manager. 这肯定比添加xmonad功能使用非根窗口要困难得多,但是它具有可以与任何窗口管理器一起使用的优点。

Another approach could be to just yank code out of xmonad and paste it into your app... 另一种方法可能是仅从xmonad中提取代码并将其粘贴到您的应用中...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在gnome w / xmonad中,如何在插入显示器或对接笔记本电脑时调用脚本? - In gnome w/ xmonad, how can I call a script when a monitor is plugged in OR when docking my laptop? Java Web Start应用程序在XMonad上显示空窗口 - Java Web Start application shows empty window on XMonad 将 window 移动到工作区并将该工作区 (shiftAndView) 集中在 XMonad WM 上 - Move window to workspace and focus that workspace (shiftAndView) on XMonad WM 如何更改从LKM添加到内核的变量? - how can I change a variable I added to the kernel from an LKM? 如何检测 Crostini 中的活动 window? - How can I detect the active window in Crostini? 如何在新的终端窗口或标签中使用从终端外壳脚本设置的变量? (OSX) - How can I use variables set from a terminal shell script in a new terminal window or tab? (OSX) 如何从客户端更改python中的服务器目录? - How can i change server directory in python from client? 如何从腻子终端窗口向所有连接的客户端发送命令? - How can I send a command to all connected clients from a putty terminal window? 如何从linux中的命令行打开Sublime Text 2文件到选项卡,而不是新窗口 - How can I open Sublime Text 2 files from the command line in linux to a tab, not a new window 如何禁用或隐藏Linux窗口的关闭按钮? - How can I disable or hide the close button of a Linux window?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM