Here's the patch. (Though I still prefer github pull requests.)

I'm not sure that all the changes in ewmh.c are really necessary.

~~~~~~~~~~~~~~~~~~~~~~~~~~

The below patch introduces a new style property MwmHintsIgnore. When
this property is set, MWM hints requested by the application, are
blocked, and the default properties are used.

~~~~~~~~~~~~~~~~~~~~~~~~~~

>From 34bd4ed36feac160f5fcf9741d14f79e01d2a004 Mon Sep 17 00:00:00 2001
From: Dov Grobgeld <dov.grobg...@gmail.com>
Date: Tue, 9 Jun 2015 10:34:24 +0300
Subject: [PATCH] Introduced MwmHintsIgnore style property to block all MWM
 hints.

---
 fvwm/decorations.c  |  4 ++--
 fvwm/ewmh.c         | 16 ++++++++++++++++
 fvwm/fvwm.h         |  1 +
 fvwm/style.c        |  6 ++++++
 fvwm/style.h        |  4 ++++
 fvwm/window_flags.h |  2 ++
 6 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/fvwm/decorations.c b/fvwm/decorations.c
index 0f39696..51fe2eb 100644
--- a/fvwm/decorations.c
+++ b/fvwm/decorations.c
@@ -344,7 +344,7 @@ void SelectDecor(FvwmWindow *t, window_style
*pstyle, short *buttons)

     decor = MWM_DECOR_ALL;
     t->functions = MWM_FUNC_ALL;
-    if (t->mwm_hints)
+    if (!DO_MWM_HINTS_IGNORE(pstyle) && t->mwm_hints)
     {
         prop = (PropMwmHints *)t->mwm_hints;
         if (SHAS_MWM_DECOR(sflags))
@@ -524,7 +524,7 @@ void SelectDecor(FvwmWindow *t, window_style
*pstyle, short *buttons)
     SET_HAS_TITLE(t, 0);
     SET_HAS_HANDLES(t, 0);

-    used_width = 0;
+        used_width = 0;
     if (decor & MWM_DECOR_BORDER)
     {
         /* A narrow border is displayed (5 pixels - 2 relief, 1 top,
diff --git a/fvwm/ewmh.c b/fvwm/ewmh.c
index 96cfdac..c6375ce 100644
--- a/fvwm/ewmh.c
+++ b/fvwm/ewmh.c
@@ -1343,6 +1343,10 @@ int ewmh_HandleDesktop(EWMH_CMD_ARGS)
     S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1);
     S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1);

+    S_SET_DO_MWM_HINTS_IGNORE(SCF(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCM(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCC(*style), 0);
+
     S_SET_IS_UNICONIFIABLE(SCF(*style), 1);
     S_SET_IS_UNICONIFIABLE(SCM(*style), 1);
     S_SET_IS_UNICONIFIABLE(SCC(*style), 1);
@@ -1426,6 +1430,10 @@ int ewmh_HandleDock(EWMH_CMD_ARGS)
     S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1);
     S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1);

+    S_SET_DO_MWM_HINTS_IGNORE(SCF(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCM(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCC(*style), 0);
+
     S_SET_IS_UNICONIFIABLE(SCF(*style), 1);
     S_SET_IS_UNICONIFIABLE(SCM(*style), 1);
     S_SET_IS_UNICONIFIABLE(SCC(*style), 1);
@@ -1471,6 +1479,10 @@ int ewmh_HandleMenu(EWMH_CMD_ARGS)
     S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1);
     S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1);

+    S_SET_DO_MWM_HINTS_IGNORE(SCF(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCM(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCC(*style), 0);
+
     /* NeverFocus */
     FPS_LENIENT(S_FOCUS_POLICY(SCF(*style)), 0);
     FPS_LENIENT(S_FOCUS_POLICY(SCM(*style)), 1);
@@ -1527,6 +1539,10 @@ int ewmh_HandleToolBar(EWMH_CMD_ARGS)
     S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1);
     S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1);

+    S_SET_DO_MWM_HINTS_IGNORE(SCF(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCM(*style), 0);
+    S_SET_DO_MWM_HINTS_IGNORE(SCC(*style), 0);
+
     /* no title ? MWM hints should be used by the app but ... */

     return 1;
diff --git a/fvwm/fvwm.h b/fvwm/fvwm.h
index ddeb8c9..d1256d5 100644
--- a/fvwm/fvwm.h
+++ b/fvwm/fvwm.h
@@ -226,6 +226,7 @@ typedef struct
         unsigned do_shrink_windowshade : 1;
         unsigned do_stack_transient_parent : 1;
         unsigned do_window_list_skip : 1;
+        unsigned do_mwm_hints_ignore : 1;
         unsigned ewmh_maximize_mode : 2; /* see ewmh.h */
         unsigned has_depressable_border : 1;
         unsigned has_mwm_border : 1;
diff --git a/fvwm/style.c b/fvwm/style.c
index eebf4f8..96db4d9 100644
--- a/fvwm/style.c
+++ b/fvwm/style.c
@@ -3285,6 +3285,12 @@ static Bool style_parse_one_style_option(
             ps->flag_mask.has_mwm_functions = 1;
             ps->change_mask.has_mwm_functions = 1;
         }
+        else if (StrEquals(token, "MwmHintsIgnore"))
+        {
+            S_SET_DO_MWM_HINTS_IGNORE(SCF(*ps), on);
+            S_SET_DO_MWM_HINTS_IGNORE(SCM(*ps), 1);
+            S_SET_DO_MWM_HINTS_IGNORE(SCC(*ps), 1);
+        }
         else if (StrEquals(token, "MouseFocus"))
         {
             style_set_old_focus_policy(ps, 1);
diff --git a/fvwm/style.h b/fvwm/style.h
index 0a2bc68..56c7398 100644
--- a/fvwm/style.h
+++ b/fvwm/style.h
@@ -151,8 +151,12 @@
     ((c).is_sticky_across_desks = !!(x))
 #define S_DO_CIRCULATE_SKIP(c) \
     ((c).s.do_circulate_skip)
+#define S_DO_MWM_HINTS_IGNORE(c) \
+    ((c).s.do_mwm_hints_ignore)
 #define S_SET_DO_CIRCULATE_SKIP(c,x) \
     ((c).s.do_circulate_skip = !!(x))
+#define S_SET_DO_MWM_HINTS_IGNORE(c,x) \
+    ((c).s.do_mwm_hints_ignore = !!(x))
 #define S_DO_CIRCULATE_SKIP_ICON(c) \
     ((c).s.do_circulate_skip_icon)
 #define S_SET_DO_CIRCULATE_SKIP_ICON(c,x) \
diff --git a/fvwm/window_flags.h b/fvwm/window_flags.h
index 9aa762e..7a3c03c 100644
--- a/fvwm/window_flags.h
+++ b/fvwm/window_flags.h
@@ -29,6 +29,8 @@
     (fw)->flag_mask.common.s.do_shrink_windowshade = !!(x)
 #define DO_SKIP_CIRCULATE(fw) \
     ((fw)->flags.common.s.do_circulate_skip)
+#define DO_MWM_HINTS_IGNORE(fw) \
+    ((fw)->flags.common.s.do_mwm_hints_ignore)
 #define SET_DO_SKIP_CIRCULATE(fw,x) \
     (fw)->flags.common.s.do_circulate_skip = !!(x)
 #define SETM_DO_SKIP_CIRCULATE(fw,x) \
-- 
2.4.2


On Tue, Jun 9, 2015 at 10:24 AM, Thomas Adam <tho...@fvwm.org> wrote:
>
> On 9 Jun 2015 08:09, "Dov Grobgeld" <dov.grobg...@gmail.com> wrote:
>>
>> As suggested privately by Elliot S, I created a new style property
>> MwmHintsIgnore that has the desired effect. When set, the Mwm hints
>> that are responsible for erasing the title and the handles, are
>> ignored, and thus the default styles are used.
>>
>> Is there an "official" fvwm repo for pull requests?
>
> For what? If you've patches, send them through.
>
>> Regards,
>> Dov
>>
>> On Tue, Jun 9, 2015 at 8:06 AM, Dov Grobgeld <dov.grobg...@gmail.com>
>> wrote:
>> >
>> > There are some desktop applications like evince and gThumb that either
>> > don't exist in mate or are not up-to-date. I therefore prefer using
>> > the latest gnome apps.
>> >
>> > Meanwhile I have improved my patch to decorations.c (after realizing
>> > that the resource name is available through the FvwmWindow pointer!)
>> > so it is a bit better as it at black lists on the application name and
>> > not its title:
>> >
>> >     // Ugly work around to force border width and
>> >     // title on some gnome applications.
>> >     if (strcmp(t->class.res_name,"eog")==0
>> >         || strcmp(t->class.res_name,"evince")==0
>> >         || strcmp(t->class.res_name,"nautilus")==0
>> >         || strcmp(t->class.res_name,"gthumb")==0
>> >         )
>> >           decor = -1;
>> >
>> > I still hope to figure out why the style settings do not provide the
>> > same functionality.
>> >
>> > Regards,
>> > Dov
>> >
>> >
>> > On Tue, Jun 9, 2015 at 5:45 AM, Michael Großer <michael.gros...@gmx.de>
>> > wrote:
>> > > Dov Grobgeld wrote:
>> > >> Hello,
>> > >>
>> > >> In recent Gnome applications, e.g. gthumb, evince, eog, there has
>> > >> been
>> > >> a trend to remove the window manager border and title and do these
>> > >> "internally" in the application. I have been looking for a gnome way
>> > >> of turning off this behavior as it seriously destroys my work flow,
>> > >> and after failing to do so, I tried to make my prefered window
>> > >> manager
>> > >> the last twenty years, fvwm, block these requests, but so far without
>> > >> any success.
>> > >>
>> > >> I have tried the following configuration parameters:
>> > >>
>> > >> Style "*"           GNOMEIgnoreHints
>> > >> Style "*"           Title,Handles
>> > >>
>> > >> But unfortunately these are ignored for the gnome windows that still
>> > >> end up with the following properties as can be seen by fvwm identify:
>> > >>
>> > >> Boundary Width: 0
>> > >> NoTitle: Yes
>> > >>
>> > >> Why are these requests ignored? Is there any other property that can
>> > >> be used to force the title and the handles? If not, could someone
>> > >> point me to the sources where this request is received and how it is
>> > >> handled, and where I could block it?
>> > >>
>> > >> Thanks!
>> > >> Dov
>> > >>
>> > >>
>> > >
>> > > Hi!
>> > >
>> > > I don't know if this helps you or other FVWM users, and I don't
>> > > know how sustainable my solution really is, but...
>> > >
>> > > ... some weeks ago, I set up a new productive environment based
>> > > on Debian Wheezy (Jessie was not stable yet back then).
>> > >
>> > > I too use some tools from KDE and Gnome such as 'konqueror',
>> > > 'ksnapshot' or 'gedit'.
>> > >
>> > > When using 'gedit' on my FVWM based desktop, I noticed strange
>> > > behavior: The current tab looks exactly like all other tabs
>> > > (so I cannot optically find out wich one is active) and the
>> > > title bar is not updated correctly by 'gedit'.
>> > >
>> > > My solution is:
>> > > - I strictly do not use tools from KDE4 and Gnome.
>> > > - Instead, I installed Trinity (the fork of KDE3)
>> > >   and MATE (the fork of Gnome 2)
>> > >
>> > > So my tools are now 'konqueror' / 'ksnapshot' from Trinity
>> > > and the name of my 2nd editor is 'pluma' now instead of 'gedit'.
>> > >
>> > > The result: Everything works fine (insofar as one can expect from
>> > > a thoroughly tailored VNC environment - working with xvnc4viewer).
>> > >
>> > > I don't know which nasty surprises I will expect when I will
>> > > setup my first Debian Jessie environment with the
>> > > same strategy, but with Wheezy, I just got away with that,
>> > > particularly also because I do not need some really new
>> > > features of the tools I use from Trinity and MATE and
>> > > because I can be sure that the forks are maintained to some
>> > > degree (regarding security aspects and so on) by their
>> > > respective maintainers.
>> > >
>> > > So, try looking whether MATE provides all you need from
>> > > Gnome, and perhaps you will be happy for the next few years.
>> > >
>> > > Greetings from Germany,
>> > > Michael
>>

Reply via email to