Enlightenment CVS committal Author : mej Project : eterm Module : Eterm
Dir : eterm/Eterm/src Modified Files: events.c options.c options.h screen.c term.c Log Message: Wed May 14 14:54:16 2008 Michael Jennings (mej) Modified patch from [EMAIL PROTECTED] to allow setting of the "Urgent" hint on beep. ---------------------------------------------------------------------- =================================================================== RCS file: /cvs/e/eterm/Eterm/src/events.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -3 -r1.67 -r1.68 --- events.c 13 Feb 2006 19:52:45 -0000 1.67 +++ events.c 14 May 2008 21:54:44 -0000 1.68 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: events.c,v 1.67 2006/02/13 19:52:45 mej Exp $"; +static const char cvs_ident[] = "$Id: events.c,v 1.68 2008/05/14 21:54:44 mej Exp $"; #include "config.h" #include "feature.h" @@ -200,6 +200,7 @@ unsigned char handle_key_press(event_t *ev) { + XWMHints *wm_hints; #ifdef COUNT_X_EVENTS static unsigned long keypress_cnt = 0; #endif @@ -214,6 +215,12 @@ if (!(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_NO_INPUT))) { lookup_key(ev); } + if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT)) { + wm_hints = XGetWMHints(Xdisplay, TermWin.parent); + wm_hints->flags &= ~XUrgencyHint; + XSetWMHints(Xdisplay, TermWin.parent, wm_hints); + XFree(wm_hints); + } PROF_DONE(handle_key_press); PROF_TIME(handle_key_press); return 1; @@ -453,6 +460,7 @@ unsigned char handle_focus_in(event_t *ev) { + XWMHints *wm_hints; D_EVENTS(("handle_focus_in(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window)); @@ -488,6 +496,12 @@ if (xim_input_context != NULL) XSetICFocus(xim_input_context); #endif + if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT)) { + wm_hints = XGetWMHints(Xdisplay, TermWin.parent); + wm_hints->flags &= ~XUrgencyHint; + XSetWMHints(Xdisplay, TermWin.parent, wm_hints); + XFree(wm_hints); + } } return 1; } =================================================================== RCS file: /cvs/e/eterm/Eterm/src/options.c,v retrieving revision 1.144 retrieving revision 1.145 diff -u -3 -r1.144 -r1.145 --- options.c 30 Oct 2006 21:12:12 -0000 1.144 +++ options.c 14 May 2008 21:54:45 -0000 1.145 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: options.c,v 1.144 2006/10/30 21:12:12 mej Exp $"; +static const char cvs_ident[] = "$Id: options.c,v 1.145 2008/05/14 21:54:45 mej Exp $"; #include "config.h" #include "feature.h" @@ -311,6 +311,7 @@ SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", vt_options, VT_OPTIONS_MAP_ALERT), # endif #endif + SPIFOPT_BOOL_LONG("urg-alert", "set urgent hint on beep", vt_options, VT_OPTIONS_URG_ALERT), #ifdef META8_OPTION SPIFOPT_BOOL('8', "meta-8", "Meta key toggles 8-bit", vt_options, VT_OPTIONS_META8), #endif @@ -1078,6 +1079,12 @@ libast_print_warning("Support for the map_alert attribute was not compiled in, ignoring\n"); #endif + } else if (!BEG_STRCASECMP(buff, "urg_alert ")) { + if (bool_val) { + BITFIELD_SET(vt_options, VT_OPTIONS_URG_ALERT); + } else { + BITFIELD_CLEAR(vt_options, VT_OPTIONS_URG_ALERT); + } } else if (!BEG_STRCASECMP(buff, "visual_bell ")) { if (bool_val) { BITFIELD_SET(vt_options, VT_OPTIONS_VISUAL_BELL); @@ -3808,6 +3815,7 @@ fprintf(fp, "begin toggles\n"); fprintf(fp, " map_alert %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_MAP_ALERT) ? 1 : 0)); + fprintf(fp, " urg_alert %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT) ? 1 : 0)); fprintf(fp, " visual_bell %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_VISUAL_BELL) ? 1 : 0)); fprintf(fp, " login_shell %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_LOGIN_SHELL) ? 1 : 0)); fprintf(fp, " scrollbar %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR) ? 1 : 0)); =================================================================== RCS file: /cvs/e/eterm/Eterm/src/options.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -3 -r1.55 -r1.56 --- options.h 30 Oct 2006 21:12:12 -0000 1.55 +++ options.h 14 May 2008 21:54:45 -0000 1.56 @@ -42,6 +42,7 @@ # define VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND (1LU << 11) # define VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND (1LU << 12) # define VT_OPTIONS_COLORS_SUPPRESS_BOLD (1LU << 13) +# define VT_OPTIONS_URG_ALERT (1LU << 14) # define ETERM_OPTIONS_LOGIN_SHELL (1LU << 0) # define ETERM_OPTIONS_ICONIC (1LU << 1) =================================================================== RCS file: /cvs/e/eterm/Eterm/src/screen.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -3 -r1.88 -r1.89 --- screen.c 13 Feb 2006 19:52:45 -0000 1.88 +++ screen.c 14 May 2008 21:54:45 -0000 1.89 @@ -3,7 +3,7 @@ * */ -static const char cvs_ident[] = "$Id: screen.c,v 1.88 2006/02/13 19:52:45 mej Exp $"; +static const char cvs_ident[] = "$Id: screen.c,v 1.89 2008/05/14 21:54:45 mej Exp $"; #include "config.h" #include "feature.h" @@ -1552,6 +1552,14 @@ void scr_bell(void) { + XWMHints *wm_hints; + + if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT)) { + wm_hints = XGetWMHints(Xdisplay, TermWin.parent); + wm_hints->flags |= XUrgencyHint; + XSetWMHints(Xdisplay, TermWin.parent, wm_hints); + XFree(wm_hints); + } #ifndef NO_MAPALERT #ifdef MAPALERT_OPTION if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_MAP_ALERT)) =================================================================== RCS file: /cvs/e/eterm/Eterm/src/term.c,v retrieving revision 1.111 retrieving revision 1.112 diff -u -3 -r1.111 -r1.112 --- term.c 13 Feb 2006 19:52:45 -0000 1.111 +++ term.c 14 May 2008 21:54:45 -0000 1.112 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: term.c,v 1.111 2006/02/13 19:52:45 mej Exp $"; +static const char cvs_ident[] = "$Id: term.c,v 1.112 2008/05/14 21:54:45 mej Exp $"; #include "config.h" #include "feature.h" @@ -2618,6 +2618,10 @@ wm_hints->input = ((BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_NO_INPUT)) ? False : True); XSetWMHints(Xdisplay, TermWin.parent, wm_hints); XFree(wm_hints); + break; + case 28: + nstr = (char *) strsep(&tnstr, ";"); + OPT_SET_OR_TOGGLE(nstr, vt_options, VT_OPTIONS_URG_ALERT); break; case 40: nstr = (char *) strsep(&tnstr, ";"); ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs