views:

49

answers:

1

We've got a (perhaps?) unusual situation where we have a lot of applications built on Qt 4 and some applications built in Java (Swing) but we're using KDE 3. We're on Red Hat Enterprise Linux 5 and since there's no official version of KDE 4 for it, upgrading to KDE 4 is not a possible option.

One of the things on our project our customers require is the ability to have certain applications open up on different desktops. After sifting through the KDE 3 API, it seems that the main way to do this using the KWin::setOnDesktop function.

Unfortunately, using that function requires linking with KDE's libraries (libkdecore) and that you can include the KDE 3 header files, which include a bunch of Qt 3 stuff. Hence, we can't actually have any of the Qt 4 applications talk directly to KDE.

The problem for Java applications is that getting the X11 window id is a huge pain since it requires going through JNI calls. (There's a handy StackOverflow page about Java and X11 interaction here.)

Does anyone have any advice about how to move windows between desktops in this situation? Thanks for any ideas.

+1  A: 

KDE4 also has a setOnDesktop method that will talk with KDE3's KWin window manager (or any other sane window manager). It's in KWindowSystem class. You can use that in your applications.

The point is that setOnDesktop method will use underlying X11 protocol to do the job. It doesn't matter that the application is written with one technology, and the window manager in another.

Tadeusz A. Kadłubowski