From 46e0036e55bdebdfc4a05f9c66e73718ba08d2fa Mon Sep 17 00:00:00 2001 From: mdw Date: Thu, 3 Dec 1998 00:39:27 +0000 Subject: [PATCH] Handling for my weird focus rules. --- mdwfocus.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mdwfocus.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 mdwfocus.c create mode 100644 mdwfocus.h diff --git a/mdwfocus.c b/mdwfocus.c new file mode 100644 index 0000000..dced194 --- /dev/null +++ b/mdwfocus.c @@ -0,0 +1,69 @@ +/* -*-c-*- + * + * $Id: mdwfocus.c,v 1.1 1998/12/03 00:39:27 mdw Exp $ + * + * Tell my hacked `fvwm' to focus this window + * + * (c) 1998 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of the Edgeware X tools collection. + * + * X tools is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * X tools is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with X tools; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: mdwfocus.c,v $ + * Revision 1.1 1998/12/03 00:39:27 mdw + * Handling for my weird focus rules. + * + */ + +/*----- Header files ------------------------------------------------------*/ + +#include +#include + +#include +#include + +/*----- Main code ---------------------------------------------------------*/ + +/* --- @mdwfocus@ --- * + * + * Arguments: @GtkWidget *w@ = widget to mark as must-be-focussed. + * + * Returns: --- + * + * Use: Marks a window as wanting to have focus `anyway', even if + * normally disabled. This only works with my hacked `fvwm' + * version. + */ + +void mdwfocus(GtkWidget *w) +{ + static GdkAtom a = 0; + unsigned char c = 1; + + if (!a) + a = gdk_atom_intern("FVWM_GIVE_ME_FOCUS", 0); + gdk_property_change(w->window, a, XA_CARDINAL, 8, + GDK_PROP_MODE_REPLACE, &c, 1); +} + +/*----- That's all, folks -------------------------------------------------*/ diff --git a/mdwfocus.h b/mdwfocus.h new file mode 100644 index 0000000..b04af46 --- /dev/null +++ b/mdwfocus.h @@ -0,0 +1,69 @@ +/* -*-c-*- + * + * $Id: mdwfocus.h,v 1.1 1998/12/03 00:39:27 mdw Exp $ + * + * Tell my hacked `fvwm' to focus this window + * + * (c) 1998 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of the Edgeware X tools collection. + * + * X tools is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * X tools is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with X tools; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: mdwfocus.h,v $ + * Revision 1.1 1998/12/03 00:39:27 mdw + * Handling for my weird focus rules. + * + */ + +#ifndef MDWFOCUS_H +#define MDWFOCUS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/*----- Header files ------------------------------------------------------*/ + +#include + +/*----- Functions provided ------------------------------------------------*/ + +/* --- @mdwfocus@ --- * + * + * Arguments: @GtkWidget *w@ = widget to mark as must-be-focussed. + * + * Returns: --- + * + * Use: Marks a window as wanting to have focus `anyway', even if + * normally disabled. This only works with my hacked `fvwm' + * version. + */ + +extern void mdwfocus(GtkWidget */*w*/); + +/*----- That's all, folks -------------------------------------------------*/ + +#ifdef __cplusplus + } +#endif + +#endif -- 2.11.0