Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mouse cursor not displaying

36 views
Skip to first unread message

Charlie

unread,
May 28, 2012, 12:10:13 PM5/28/12
to
I am trying to make a workaround for a game in wine (M1 tank platoon
2) to force the cursor to display in the game's menu but haven't had
any luck. I tried to set the cursor to the default pointer with this
code (xid is the X window id of the main game window):

csr = XCreateFontCursor (g_display, XC_left_ptr);
XDefineCursor (g_display, xid, csr);

XQueryTree (g_display, xid, &root, &parent, &children, &n);
if ((n > 0) && (children != NULL))
{
for (i = 0; i < (int) n; i++)
{
XDefineCursor (g_display, children[i], csr);
}
XFree (children);
}

XFreeCursor (g_display, csr);

However the above code has no effect on this game. This code does
change the pointer in other windows I have tried.

Does anyone know what could cause a mouse cursor to not be shown?

Thanks in advance,
Charlie

Lew Pitcher

unread,
May 28, 2012, 12:08:42 PM5/28/12
to
On Monday 28 May 2012 12:10, in comp.windows.x, nos...@embarqmail.com wrote:

> I am trying to make a workaround for a game in wine (M1 tank platoon
> 2) to force the cursor to display in the game's menu but haven't had
> any luck. I tried to set the cursor to the default pointer with this
> code (xid is the X window id of the main game window):
[snip code]
> However the above code has no effect on this game. This code does
> change the pointer in other windows I have tried.
>
> Does anyone know what could cause a mouse cursor to not be shown?

I don't know, but I know who to ask.

Wine provides a Microsoft Windows environment running under X on x86 Unix
systems. The MSWindows GUI environment is sufficiently different from X
(both in available controls, and exposed API) that Wine probably does a lot
of work translating between X and MSWindows GUI. It doesn't surprise me
that external X operations fail to have the expected effect on the
MSWindows GUI.

Having said all that, you probably would get a reasonable answer from the
comp.emulators.ms-windows.wine newsgroup, or through the WineHQ help tools
(http://www.winehq.org/help/) (WineHQ is the source of Wine)

HTH
--
Lew Pitcher

Charlie

unread,
Jun 1, 2012, 5:30:29 PM6/1/12
to
I tried posting in the wine forums but haven't had any luck either:

http://forum.winehq.org/viewtopic.php?t=15763

I realize wine is for ms windows programs but the end result has to
be an x window. What confuses me is what could cause an x window to
ignore mouse cursor functions. Even if it was an opengl window,
which it probably is, it still should respond to setting a new
cursor. A quick look at the glX functions shows no function to set a
window's cursor.

Any ideas?

Thanks again,
Charlie

FredK

unread,
Jun 4, 2012, 10:36:54 AM6/4/12
to
You didn't mention what this game was. Is it possible that the game itself keeps setting its own cursor? I have several apps that set the cursor to a specific one in response to WindowEntered events.

Charlie

unread,
Jun 5, 2012, 5:18:26 PM6/5/12
to
The game is "M1 Tank Platoon II" running under Wine. I think the
game hides the normal cursor and makes a fake one with a direct x
texture. The invisible cursor problem is only with the menus. The
game play cursor is visible.

I don't even get a cursor for a split second when I try using that
code like the game itself or wine was setting it back. I don't think
X generates an events when the cursor changes so the game really
shouldn't know if it was changed. Strange issue.

I did make a fairly good workaround. I use a key to grab the mouse
pointer with the desktop then I can see the cursor anywhere. I just
hit the same key again to turn the grab off or left click to turn
off when the pointer is where I want it. Not quite what I wanted but
it works.

If anyone knows what is causing the hidden cursor problem I would
like to know.


0 new messages