Events get lost using driver later than 1.2.7

Post questions, comments and feedback to our 3Dconnexion UNIX and Linux Development Team.

Moderator: Moderators

Post Reply
jjmcwill
Posts: 6
Joined: Wed May 30, 2007 12:22 pm
Location: Troy, MI

Events get lost using driver later than 1.2.7

Post by jjmcwill » Fri Jan 04, 2008 2:03 pm

I'm working on Spaceball support for Altair HyperWorks, including HyperView, HyperGraph 3D, and Motion View.

With the 1.2.7 drivers on 64-bit CentOS 4 Linux, things worked well.
However, with 1.2.11 and 1.2.17, I've been running into problems.

With 1.2.11 and 1.2.17, any effort to customize the 3DConnexion configuration results in the app no longer receiving events.

This was not a problem with the 1.2.7 driver.

Our application runs under MainSoft's MainWin framework under Linux/Unix, allowing developers to largely target MFC as the development framework under both Windows and Unix.

Unfortunately, this means that I have no control over the X Event loop as required by your Unix driver. The X Event loop is buried in the MainWin runtime and there's no way to tell it to pass through the XEvents that 3DConnexion uses, or to interpret them as WM_USER events.

I was able to get around this limitation by opening a separate connection to the X display, create a hidden window, and use that window id in the call to MagellanInit().

There is then a MainWin call that I can make, passing the 2nd X connection file descriptor, and MainWin will trigger a callback in our code when it receives events on the 2nd display connection. The callback receives the 3DConnexion events that came via the hidden window, and we interpret them.

To keep the events flowing, I call MagellanSetWindow() whenever the user clicks in the client area of our app so that our app can re-establish focus with the 3dconnexion driver.

Like I said, this worked well with the 1.2.7 driver, but I'm having lots of problems using the 1.2.11 or 1.2.17 drivers. It seems to be sort of window focus related, and also tied to whether or not I try to customize the default configuration. If I have the default configuration, receiving events seems to work mostly okay, but there are still window focus quirks. If I try to customize the configuration by mapping different events to buttons, changing acceleration via the panel, etc, things break immediately.

What can be done to address this? 3Dconnexion support in our app is now questionable with later Linux (and I'm assuming HPUX, AIX, Solaris) drivers.

Jeff McWilliams
Senior Software Engineer - Altair
Jeff McWilliams - jjmcwill@altair.com

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH » Mon Jan 07, 2008 9:12 am

Hi Jeff,

did you create a configuration file for your app? What does it say in line 14?

Code: Select all

APP_WINDOW_NAME = { "" }
Do you have a name for your window there? Is this different for driver version 1.2.7 and the newer ones?

What is the name of the window that you use for MagellanSetWindow()?

Uta Ludwig
3Dconnexion

jjmcwill
Posts: 6
Joined: Wed May 30, 2007 12:22 pm
Location: Troy, MI

Post by jjmcwill » Mon Jan 07, 2008 10:35 am

With the 1.2.7 driver, line 14 reads:"
APP_WINDOW_NAME = "HyperWorks"

With the 1.2.17 driver, after saving the configuration, line 14 of the file reads:

APP_WINDOW_NAME = { "MainWin" }


Here is the code that creates the window I'm using in the call to MagellanInit() and MagellanSetWindow():

Code: Select all

    char *WinName = "HyperWorks v9.0 3DConnexion";
    ...
    ...
    _window = XCreateSimpleWindow(_display, root, 0, 0, width, height, 0,
                                  BlackPixel(_display, screennumber),
                                  WhitePixel(_display, screennumber));

    XStringListToTextProperty(&WinName, 1, &windowName);
    wmhints->initial_state = WithdrawnState;
    wmhints->input = TRUE;
    wmhints->flags = StateHint | InputHint;

    classhints->res_name = "hw";
    classhints->res_class = "HyperWorks";
    XSetWMProperties(_display, _window, &windowName, NULL, NULL, 0,
                     sizehints, wmhints, classhints);
Jeff McWilliams - jjmcwill@altair.com

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Change of your config file

Post by UtaSH » Tue Jan 08, 2008 6:48 am

Hi Jeff,

please try the following:
add in your configuration file for HyperWorks both window names:
  • APP_WINDOW_NAME = { "MainWin", "HyperWorks" }
and use this config file with the latest driver. Does this work?

If you start HyperWorks and open the window and then launch from a command line
  • /etc/3DxWare/daemon/3dxsrv -class
you should get some output. Can you please let me know what it says? Thx.

Uta

jjmcwill
Posts: 6
Joined: Wed May 30, 2007 12:22 pm
Location: Troy, MI

Post by jjmcwill » Tue Jan 08, 2008 11:35 am

Here is the output from "3dxsrv -class" while app is running and file loaded:

Code: Select all

[root@brisbane etc]# /etc/3DxWare/daemon/3dxsrv -class
 01200029 [desktop_window|Nautilus|Desktop] 
   01200072 [nautilus|Nautilus|File Manager] 
  02600012 [xterm|XTerm|jjmcwill@brisbane:~/.3dxcfg] 
  02C000AE [Hw|MainWin|bumper.mvw - HyperWorks v9.0] 
    03000028 [postPanel|Toplevel|postPanel] 
    03000026 [postTb|Toplevel|postTb] 
  02A000F4 [main|3DxSrv|3DxWare 1.2.17] 
  02400012 [xterm|XTerm|root@brisbane:/etc] 
 00E00037 [gnome-panel|Gnome-panel|Bottom Panel] 
     01A00003 [wnck-applet|Wnck-applet|wnck-applet] 
     01A00035 [wnck-applet|Wnck-applet|wnck-applet] 
     01C00003 [multiload-applet-2|Multiload-applet-2|multiload-applet-2] 
     01A00045 [wnck-applet|Wnck-applet|wnck-applet] 
 00E00004 [gnome-panel|Gnome-panel|Top Panel] 
     01E00003 [mixer_applet2|Mixer_applet2|mixer_applet2] 
     02000004 [clock-applet|Clock-applet|clock-applet] 
     02200029 [notification-area-applet|Notification-area-applet|notification-area-applet] 
        01600003 [pam-panel-icon|Pam-panel-icon|Authentication Indicator] 
        01800003 [rhn-applet|Rhn-applet-gui|rhn-applet] 
Modifying line 14 as you suggest did not help.

However, I have noticed the following additional behavior:

If I map a SpaceMoue button to the "Save" function.
While HyperView has focus, hit SM button to save profile, then click OK, sensor input is once again received by HyperView.

If I click back in HyperView window, sensor input is once again lost.

This was not a problem with 1.2.7 drivers.

Jeff
Jeff McWilliams - jjmcwill@altair.com

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH » Wed Jan 09, 2008 6:06 am

Hi Jeff,
looking at the output of the command I wonder that with version 1.2.7 the configuration worked with line 14
  • APP_WINDOW_NAME = "HyperWorks"
The driver identifies an app via the class name or resource name or window name. This is for your app
  • [Hw|MainWin|bumper.mvw - HyperWorks v9.0]
OTH I wonder as well that it does not work with "MainWin". :?

We are currently looking into the issue with the focus. Could be that there is a problem with apps that call MagellanSetWindow(). I will post here if we find something.

Uta Ludwig
3Dconnexion

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH » Thu Jan 10, 2008 9:35 am

Jeff,

would it work (with 1.2.17) if you change the APP_WINDOW_NAME (in your config file) to the name of your invisible window?

Code: Select all

APP_WINDOW_NAME = "HyperWorks v9.0 3DConnexion"
Uta

jjmcwill
Posts: 6
Joined: Wed May 30, 2007 12:22 pm
Location: Troy, MI

Post by jjmcwill » Mon Jan 14, 2008 9:54 am

When I change APP_WINDOW_NAME to "HyperWorks v9.0 3DConnexion", then restart 3dxsrv and our app,

My SpacePilot display shows "Any Application" not the saved configuration. Bringing up the Panel shows the same thing.

We're working toward a release candidate build for our products within weeks. If we can't resolve the problems with the Linux/Unix driver, we may have to drop support for Spaceball on those platforms and only support Windows.
Jeff McWilliams - jjmcwill@altair.com

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH » Wed Jan 16, 2008 8:31 am

Here is an update on this thread:

Jeff found out that it works as expected if he just enters "Hyperworks" in the config file

Code: Select all

APP_WINDOW_NAME = "HyperWorks"
This is the name of the hidden window.

We are working on this issue with the window name of a hidden window that was registered with MagellanSetWindow(). An internal bugreport was created; the number is 4671. I will post here if we have news.

Uta

Post Reply