Has there been any advancement in discovering and/or setting which desktop/workspace my application is on (under Linux/Solaris of course)?
workspaces aka desktops in Java
703 views Asked by brad12s At
2
There are 2 answers
0
Zubzub
On
I'm the author of the project proviously linked by the "NetFrmeExtents.java"
Here's my answer:
It's hard to do in pure java if not impossible unless swing/awt has implemented it by now. The most straightforward (and only?) way is to use JNI and do it through xlib/xcb. But it is possible to do what you ask.
There is a desktop convention called EWMH that can help you with what you want. The basic order of steps you need to is:
- Get the window id of your application. To do this Google how to retrieve the window handle/window id in awt.
- Next you need to read several "properties" defined by atoms. If you don't know what this is google how to read a property from a window in xlib/xcb.
- In the EWMH there is a property that lists all virtual desktops defined by the window manager. See http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2449367
- Set the property a property on your application's window, see http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507080 to the number of the virtual desktop you want your application to be on.
If you have done everything correct and the window manager supports ewmh (most do) it should work.
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in DESKTOP
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Record all desktop internet requests and select certain requests and send it to the server
- Matlab *.m MIME type not working on linux POP OS
- Send list of opened tabs from chrome extension to electron application
- Why won't Docker Desktop in Windows launch properly?
- how to create native distributions (installers/packages) for all the supported systems with compose?
- Docker CLI exit status 1
- How to develop a desktop application that can be launched from a right-click on the finder
- How can I create a .desktop file [Desktop Entry] that executes a command in the current directory?
- How to configure XRDP to work with Gnome on Ubuntu 22.04?
- tableau color code one measure ruins subtotal on the crosstab
- Failed to connect a sqlite file in tauri + vue project?
- how to use sqlite in vue.js + tauri.js desktop app?
- Change Icons and a title of the installed application on Windows
- How to limit cpu and memory usage of the whole desktop?
Related Questions in X11
- How can I set an uncommon screen resolution on GNU/Linux with an Arc 380 GPU and X11?
- Create screenshot and encode it in base64
- Rasppberry pi Remote Desktop Conection Problem
- GithubActions - PlatformError: X11: The DISPLAY environment variable is missing
- Unable to run X11 applications remotely via XQuartz on a mac
- WSL2 OpenAI Gym - render segmentation fault
- Converting BufferedImage to Pixmap
- Is there a lightweight GUI protocol like X11 that works well over ssh?
- dropdown is closing quickly without any action when tried to open it. it is a motif Xt library based application
- XCreateWindow - parent argument implications
- Drawing image to root window in Xorg using Xcb causes it to cover other windows
- How to open a GUI-Application on a Server (Raspi) via SSH using python/paramiko?
- Switch layouts and get char without X11 by driver?
- Xrandr making DisplayWidth() return incorrect value?
- Xlib Window Manager: Closing Focused Window Causes Unexpected Shutdown
Related Questions in WORKSPACE
- Power BI Automations of Audits and APIs
- I cant figure out how to pull scripts from s3 to my aws workspace
- Salesforce Lightning Workspace API
- Feature Request: Enumeration of issues with Workspace Trust "Do you trust the authors of the file in this folder?"
- Unable to add members to Google Workspace Group
- yarn monorepo not downloading other package's dependencies
- Xcode add dependencies to "Project" OR "Target" (difference?)
- How to establish a connection between 2 folders in different workspaces in Control-M?
- Why i am getting this error message in AWS workspace creation if i have created the bundle?
- "File 'LoginPageProperties.json' not found" error in Amazon WorkSpaces login page
- load .mat file, but not on the workspace
- Blackberry Workspaces
- How do I get a new file to open in a new workspace instead of being added to an existing workspace
- Python Terminal Not running single python files but running from folders / workspaces In Visual Studio Code
- Accidentally deleted local branches after changing the workspace in VS Code
Related Questions in EWMH
- X11 virtual desktops: which are visible?
- XCB EWMH getting client list returns only Google Chrome windows
- Is it possible to add a global X11 binding via/to Sublime Text 3?
- custom window manager: Some GTK+ 3 windows receive focus but will not accept mouse clicks
- Can I use _NET_WM_WINDOW_TYPE_DOCK EWHM extension in openbox?
- How to monitor active window changes using xcb?
- No event received when X11 client sets _NET_WM_STATE_DEMANDS_ATTENTION
- How to control X11 app level window stacking?
- Get WId of active window with XCB
- How to draw titlebar with XCB
- X11: list top level windows
- Manipulating X11 window menu in a WM-agnostic way
- Getting WM name through X11 without EWMH?
- Gtk skip_taskbar_hint (seen in Glade-ui-Designer) äquivalent in Qt
- Is there a standard way to know whether window is floating or tiled?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Discovering/setting the desktop on modern window managers is done through reading/setting the
_NET_WM_DESKTOPproperty from the EWMH specification ( http://packages.debian.org/search?keywords=proftpd-basic&searchon=names&suite=all§ion=all )I'm not aware of any neatly encapsulated API's that expose this functionality, but google turned up http://code.google.com/p/ewm/source/browse/trinity/fusion-X11/trunk/src/main/java/org/fusion/x11/ewmh/NetFrameExtents.java which might be a start.