Ticket #3011 (closed enhancement: fixed)

Opened 12 years ago

Last modified 11 years ago

mc under x11 problems with mouse or hang due gpm

Reported by: acobar Owned by: slavazanko
Priority: major Milestone: 4.8.9
Component: mc-tty Version: 4.8.8
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

mc may not detect the gpm mouse under X11 on many x terminals when running together with tmux or screen.

On some cases it can even hang.

I sent a small patch to the gpm maintainer to improve its checking. Seems there is a need also to a small change on mc.

Now everything is working perfectly.

Attachments

mc-gpm-x-term-fixes.patch (8.5 KB) - added by acobar 12 years ago.
mc gpm x terminal improvments
gpm-more-x-terms.patch (650 bytes) - added by acobar 12 years ago.
gpm counterpart patch

Change History

Changed 12 years ago by acobar

mc gpm x terminal improvments

Changed 12 years ago by acobar

gpm counterpart patch

comment:1 follow-up: ↓ 2 Changed 12 years ago by slavazanko

Will it works as it worked before (without your patch which you sent to GPM devteam)? Have we backward compatibility or will be new unexpected behavior here?

comment:2 in reply to: ↑ 1 Changed 12 years ago by acobar

Replying to slavazanko:

Will it works as it worked before (without your patch which you sent to GPM devteam)? Have we backward compatibility or will be new unexpected behavior here?

From what I gathered, gpm, once it does not recognize an x terminal, assumes it is probably running on console so some race condition with X input is triggered and the hangs that people complain show up at random.

When gpm does recognize an x terminal, it returns -2 from Gpm_Open, what is a valid interpretation for it, but can not be used with select. I assume that gpm then does send mouse actions translation to keyboard input buffer though, as they are properly processed by mc after the patches.

Answering your question, I noted no regression with my patches to mc (nor on X nor on 'pure' console), but yes, I think that it is needed to patch gpm as the problem we were experiencing were related to the behavior of both, even though the segfaults where on gpm side.

The only thing I did not check was putty terminal, what I will probably tomorrow.

Best regards,
André

comment:3 Changed 12 years ago by slavazanko

  • Status changed from new to accepted
  • Owner set to slavazanko

comment:4 follow-up: ↓ 5 Changed 12 years ago by slavazanko

From patch:

+                /** Need more information first
+                const char *xdisplay;
+
+                if ((xdisplay = getenv ("DISPLAY")) != NULL && *xdisplay == '\0')
+                    xdisplay = NULL;
+                */

Is this comment needed?

comment:5 in reply to: ↑ 4 Changed 12 years ago by acobar

Replying to slavazanko:

From patch:

+                /** Need more information first
+                const char *xdisplay;
+
+                if ((xdisplay = getenv ("DISPLAY")) != NULL && *xdisplay == '\0')
+                    xdisplay = NULL;
+                */

Is this comment needed?

Right now it is not needed. I will probably make more tests on how mc process mouse inputs soon, that is why I left the comment there, to remember.

comment:6 Changed 11 years ago by slavazanko

  • Votes for changeset set to slavazanko
  • Branch state changed from no branch to on review

Created branch 3011_mc_gpm_and_xterm
Initial changeset:ff5e5487228e74b2f9d9f7efd2ca29a305e085c8

Review, please.

comment:7 Changed 11 years ago by andrew_b

  • Milestone changed from 4.8 to 4.8.9

comment:8 Changed 11 years ago by andrew_b

  • Votes for changeset changed from slavazanko to slavazanko andrew_b
  • Branch state changed from on review to approved

comment:9 Changed 11 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master.

git log --pretty=oneline ffc536f..9699d5d

comment:10 Changed 11 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.