comparison src/event-Xt.c @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents 538048ae2ab8
children 43dd3413c7c7
comparison
equal deleted inserted replaced
152:4c132ee2d62b 153:25f70ba0133c
1727 static void 1727 static void
1728 emacs_Xt_select_console (struct console *con) 1728 emacs_Xt_select_console (struct console *con)
1729 { 1729 {
1730 Lisp_Object console = Qnil; 1730 Lisp_Object console = Qnil;
1731 int infd; 1731 int infd;
1732 #ifdef HAVE_GPM
1733 int mousefd;
1734 #endif
1732 1735
1733 if (CONSOLE_X_P (con)) 1736 if (CONSOLE_X_P (con))
1734 return; /* X consoles are automatically selected for when we 1737 return; /* X consoles are automatically selected for when we
1735 initialize them in Xt */ 1738 initialize them in Xt */
1736 infd = event_stream_unixoid_select_console (con); 1739 infd = event_stream_unixoid_select_console (con);
1737 XSETCONSOLE (console, con); 1740 XSETCONSOLE (console, con);
1738 select_filedesc (infd, console); 1741 select_filedesc (infd, console);
1742 #ifdef HAVE_GPM
1743 /* On a stream device (ie: noninteractive), bad things can happen. */
1744 if (EQ (CONSOLE_TYPE (con), Qtty)) {
1745 mousefd = CONSOLE_TTY_MOUSE_FD (con);
1746 if (mousefd >= 0) {
1747 select_filedesc (mousefd, console);
1748 }
1749 }
1750 #endif
1739 } 1751 }
1740 1752
1741 static void 1753 static void
1742 emacs_Xt_unselect_console (struct console *con) 1754 emacs_Xt_unselect_console (struct console *con)
1743 { 1755 {
1744 Lisp_Object console = Qnil; 1756 Lisp_Object console = Qnil;
1745 int infd; 1757 int infd;
1758 #ifdef HAVE_GPM
1759 int mousefd;
1760 #endif
1746 1761
1747 if (CONSOLE_X_P (con)) 1762 if (CONSOLE_X_P (con))
1748 return; /* X consoles are automatically selected for when we 1763 return; /* X consoles are automatically selected for when we
1749 initialize them in Xt */ 1764 initialize them in Xt */
1750 infd = event_stream_unixoid_unselect_console (con); 1765 infd = event_stream_unixoid_unselect_console (con);
1751 XSETCONSOLE (console, con); 1766 XSETCONSOLE (console, con);
1752 unselect_filedesc (infd); 1767 unselect_filedesc (infd);
1768 #ifdef HAVE_GPM
1769 /* On a stream device (ie: noninteractive), bad things can happen. */
1770 if (EQ (CONSOLE_TYPE (con), Qtty)) {
1771 mousefd = CONSOLE_TTY_MOUSE_FD (con);
1772 if (mousefd >= 0) {
1773 unselect_filedesc (mousefd);
1774 }
1775 }
1776 #endif
1753 } 1777 }
1754 1778
1755 /* read an event from a tty, if one is available. Returns non-zero 1779 /* read an event from a tty, if one is available. Returns non-zero
1756 if an event was available. Note that when this function is 1780 if an event was available. Note that when this function is
1757 called, there should always be a tty marked as ready for input. 1781 called, there should always be a tty marked as ready for input.