File: mwmhints.c

package info (click to toggle)
notion 4.0.2%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (57 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * ion/ioncore/mwmhints.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#include "common.h"
#include "property.h"
#include "mwmhints.h"
#include "global.h"


WMwmHints *xwindow_get_mwmhints(Window win)
{
    WMwmHints *hints=NULL;
    int n;

    n=xwindow_get_property(win, ioncore_g.atom_mwm_hints,
                           ioncore_g.atom_mwm_hints,
                           MWM_N_HINTS, FALSE, (uchar**)&hints);

    if(n<MWM_N_HINTS && hints!=NULL){
        XFree((void*)hints);
        return NULL;
    }

    return hints;
}


void xwindow_check_mwmhints_nodecor(Window win, bool *nodecor)
{
    WMwmHints *hints;
    int n;

    *nodecor=FALSE;

    n=xwindow_get_property(win, ioncore_g.atom_mwm_hints,
                           ioncore_g.atom_mwm_hints,
                           MWM_N_HINTS, FALSE, (uchar**)&hints);

    if(n<MWM_DECOR_NDX)
        return;

    if(hints->flags&MWM_HINTS_DECORATIONS &&
       (hints->decorations&MWM_DECOR_ALL)==0){
        *nodecor=TRUE;

        if(hints->decorations&MWM_DECOR_BORDER ||
           hints->decorations&MWM_DECOR_TITLE)
            *nodecor=FALSE;
    }

    XFree((void*)hints);
}