X11 Button Event not Reported


 
Thread Tools Search this Thread
Top Forums Programming X11 Button Event not Reported
# 1  
Old 01-14-2017
X11 Button Event not Reported

I have a peculiar problem (aren't they all?). A new program that uses X11 fails to get any ButtonRelease event reported to it after the XNextEvent call. That is, mouse clicks don't work. The program gets others, such as exposure and keyboard events, but not button press or release. Other programs running on the same hardware obviously do get all mouse clicks. Compounding the problem, this failure occurs under Ubuntu and Mint, but all events are reported under Raspbian -- that is, under Raspbian the failure does not occur.

This is the setup instruction:
Code:
i = XSelectInput(dpy,win, ExposureMask | KeyPressMask |
        ButtonReleaseMask | KeyReleaseMask);

After issuance i contains 1.

I've read (seemingly relevant parts of) the X11 manual without gaining a clue. I'm hoping that someone else has experienced this problem and found the cause.

Would this question be more appropriate in another group? Which one?

--rLsj
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, sample output, and code segments.

Last edited by Don Cragun; 01-14-2017 at 06:00 PM.. Reason: Add CODE and ICODE tags.
# 2  
Old 01-14-2017
Quote:
Originally Posted by rlsj
this failure occurs under Ubuntu and Mint, but all events are reported under Raspbian
I am no Ubuntu expert, but i remember darkly about Ubuntu and Mint both not using X11 any more but thing called "Wayland". Might it be that it has to do with this?

I hope this helps.

bakunin
# 3  
Old 01-14-2017
Loaded Debian onto my long-suffering, ten-year-old HP Pavilion and, you guessed it, it failed also. That was my last hope. I had to get inventive.

Which I did. And fixed it, although the fix leaves a bad taste. I inserted a call to XGrabButton just before the call to XNextEvent. Now it works, would you believe! Mouse clicks are delivered to the program.

Note that it works under Raspbian without grabbing the button. And absolutely no indication appears in the X11 manual -- or the man pages -- that seems to require it. Other coders might want to take notice.

Might I next find a distro that requires XGrabKey?

Distasteful.

--rLsj

(Note to Moderator: Your "hint" about code tags, "co" over "de", is not informative.)
# 4  
Old 01-15-2017
Moderator's Comments:
Mod Comment If you're having trouble understanding how CODE and ICODE tags work, try playing the following tutorial...



Hopefully, it will be more informative.
# 5  
Old 01-15-2017
A little follow-on to my last post for coders who might be interested. The XGrabButton call that solves the problem under Debian fails under Raspbian with the message, "trying to access private resources." As usual I have no idea which resources or why they're private. And the "BADACCESS" code returned is not even mentioned on the XGrabButton man page.

It appears there'll be two versions of the program: one for Raspbian with another for Debian and probably everyone else.

--rLsj
This User Gave Thanks to rlsj For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

New Thread Button

Where do I find the New Thread Button so I can post a message to get some help in an issue I am having ? (2 Replies)
Discussion started by: kstalder
2 Replies

2. UNIX for Advanced & Expert Users

[Solved] putty+x11:How do I pass X11 display rights to "su"?

I can log into a unix system with Putty. I've set the "X11 forwarding" checkbox, and I've verified that I can display an X11 window back on my laptop. What I need to be able to do is "su" to another uid after logging in and then run something which display a window back on my laptop, with the... (2 Replies)
Discussion started by: dkarr
2 Replies

3. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies

4. UNIX for Dummies Questions & Answers

Changing middle mouse button for pasting to right mouse button in cygwin rxvt

Hi, I'm using rxvt in Cygwin and I'm wondering how to change my mouse bindings from the middle button for pasting to the right button. The main reason why I want to do this is because my laptop doesn't have a middle mouse button. Thanks for any help! (2 Replies)
Discussion started by: sayeo
2 Replies

5. UNIX for Dummies Questions & Answers

Script for using the Back button and the Close button

Here's a question I have for anyone that might be able to help me: I can write a html script that will allow the user to return to the previous page using the back button, and I can write a script that will allow the user to return to the previous page using the close button, but...is there a... (1 Reply)
Discussion started by: mdgibson
1 Replies
Login or Register to Ask a Question