On Tue, 06 Oct 2009 01:54:54 +0200, Enlightenment SVN  
<no-re...@enlightenment.org> wrote:

> Log:
>   check wm supporting hints for mwm:
>   make borderless also work with window managers that do not pretend to  
> be mwm
> Author:       jeffdameth
> Date:         2009-10-05 16:54:53 -0700 (Mon, 05 Oct 2009)
> New Revision: 42896
>
> Modified:
>   trunk/eterm/Eterm/src/windows.c
>
> Modified: trunk/eterm/Eterm/src/windows.c
> ===================================================================
> --- trunk/eterm/Eterm/src/windows.c   2009-10-05 19:34:35 UTC (rev 42895)
> +++ trunk/eterm/Eterm/src/windows.c   2009-10-05 23:54:53 UTC (rev 42896)
> @@ -363,6 +363,46 @@
>      XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
>  }
> +int
> +check_mwm_supported(void)
> +{
> +    Atom prop, mwm_prop, type_ret;
> +    unsigned char *prop_ret;
> +    unsigned long bytes_after, num_ret;
> +    int format_ret, num, i, supported = 0;
> +
> +    /* check whether wm support mwm hint */
> +    prop = XInternAtom(Xdisplay, "_NET_SUPPORTED", True);
> +    mwm_prop = XInternAtom(Xdisplay, "_MOTIF_WM_HINTS", True);
> +
> +    if ((prop != None) && (mwm_prop != None)) {
> +        prop_ret = NULL;
> +        if (XGetWindowProperty(Xdisplay, Xroot, prop, 0, 0x7fffffff,  
> False,
> +                               XA_ATOM, &type_ret, &format_ret,  
> &num_ret,
> +                               &bytes_after, &prop_ret) == Success) {
> +
> +            if ((type_ret == XA_ATOM) &&
> +                (format_ret == 32) &&
> +                (num_ret && prop_ret))
> +            {
> +                for (i = 0; i < num_ret; i++)
> +                    if (mwm_prop == ((unsigned long*)prop_ret)[i])
> +                        supported = 1;
> +            }
> +            if (prop_ret)
> +                XFree(prop_ret);
> +        }
> +    }
> +    /* check whether wm is mwm */
> +    if (!supported) {
> +        prop = XInternAtom(Xdisplay, "_MOTIF_WM_INFO", True);
> +        if (prop != None) {
> +            supported = 1;
> +        }
> +    }
> +    return supported;
> +}
> +
>  /* Create_Windows() - Open and map the window */
>  void
>  Create_Windows(int argc, char *argv[])
> @@ -378,14 +418,13 @@
>      MWMHints mwmhints;
>     if (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_BORDERLESS)) {
> -        prop = XInternAtom(Xdisplay, "_MOTIF_WM_INFO", True);
> -        if (prop == None) {
> +        if (check_mwm_supported()) {
> +            mwmhints.flags = MWM_HINTS_DECORATIONS;
> +            mwmhints.decorations = 0;
> +        } else {
>              libast_print_warning("Window Manager does not support MWM  
> hints.  Bypassing window manager control for borderless window.\n");
>              Attributes.override_redirect = TRUE;
>              mwmhints.flags = 0;
> -        } else {
> -            mwmhints.flags = MWM_HINTS_DECORATIONS;
> -            mwmhints.decorations = 0;
>          }
>      } else {
>          mwmhints.flags = 0;
>
Why?!?

It seems to me that you are making Eterm e17 compliant in stead of making  
e17 MWM hint compliant.

I don't think _MOTIF_WM_HINTS should be listed in _NET_SUPPORTED at all.  
It just makes no sense. EWMH unaware apps will certainly never look there.

If anything should be changed here, I'd consider removing the test for  
_MOTIF_WM_INFO (and going override-redirect if not set) and just set the  
MWM hint if borderless is requested.

/Kim

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to