~gala-dev/gala/windowswitcher-fade-opacity

« back to all changes in this revision

Viewing changes to src/InternalUtils.vala

  • Committer: Rico Tzschichholz
  • Date: 2014-04-08 12:51:06 UTC
  • Revision ID: ricotz@ubuntu.com-20140408125106-6ahv3pbbwilck1pi
codestyle: Drop trailing spaces/tabs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  
 
1
//
2
2
//  Copyright (C) 2012 Tom Beckmann, Rico Tzschichholz
3
 
// 
 
3
//
4
4
//  This program is free software: you can redistribute it and/or modify
5
5
//  it under the terms of the GNU General Public License as published by
6
6
//  the Free Software Foundation, either version 3 of the License, or
7
7
//  (at your option) any later version.
8
 
// 
 
8
//
9
9
//  This program is distributed in the hope that it will be useful,
10
10
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
//  GNU General Public License for more details.
13
 
// 
 
13
//
14
14
//  You should have received a copy of the GNU General Public License
15
15
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 
// 
 
16
//
17
17
 
18
18
using Meta;
19
19
 
31
31
                        var factory = ShadowFactory.get_default ();
32
32
                        var settings = ShadowSettings.get_default ();
33
33
                        Meta.ShadowParams shadow;
34
 
                        
 
34
 
35
35
                        //normal focused
36
36
                        shadow = settings.get_shadowparams ("normal_focused");
37
37
                        factory.set_params ("normal", true, shadow);
38
 
                        
 
38
 
39
39
                        //normal unfocused
40
40
                        shadow = settings.get_shadowparams ("normal_unfocused");
41
41
                        factory.set_params ("normal", false, shadow);
42
 
                        
 
42
 
43
43
                        //menus
44
44
                        shadow = settings.get_shadowparams ("menu");
45
45
                        factory.set_params ("menu", false, shadow);
46
46
                        factory.set_params ("dropdown-menu", false, shadow);
47
47
                        factory.set_params ("popup-menu", false, shadow);
48
 
                        
 
48
 
49
49
                        //dialog focused
50
50
                        shadow = settings.get_shadowparams ("dialog_focused");
51
51
                        factory.set_params ("dialog", true, shadow);
52
52
                        factory.set_params ("modal_dialog", false, shadow);
53
 
                        
 
53
 
54
54
                        //dialog unfocused
55
55
                        shadow = settings.get_shadowparams ("normal_unfocused");
56
56
                        factory.set_params ("dialog", false, shadow);
57
57
                        factory.set_params ("modal_dialog", false, shadow);
58
58
                }
59
 
                
 
59
 
60
60
                /**
61
61
                 * set the area where clutter can receive events
62
62
                 **/
63
63
                public static void set_input_area (Screen screen, InputArea area)
64
64
                {
65
65
                        var display = screen.get_display ();
66
 
                        
 
66
 
67
67
                        X.Xrectangle[] rects = {};
68
68
                        int width, height;
69
69
                        screen.get_size (out width, out height);
70
70
                        var geometry = screen.get_monitor_geometry (screen.get_primary_monitor ());
71
 
                        
 
71
 
72
72
                        switch (area) {
73
73
                                case InputArea.FULLSCREEN:
74
74
                                        X.Xrectangle rect = {0, 0, (ushort)width, (ushort)height};
76
76
                                        break;
77
77
                                case InputArea.HOT_CORNER:
78
78
                                        var schema = BehaviorSettings.get_default ().schema;
79
 
                                        
 
79
 
80
80
                                        // if ActionType is NONE make it 0 sized
81
81
                                        ushort tl_size = (schema.get_enum ("hotcorner-topleft") != ActionType.NONE ? 1 : 0);
82
82
                                        ushort tr_size = (schema.get_enum ("hotcorner-topright") != ActionType.NONE ? 1 : 0);
83
83
                                        ushort bl_size = (schema.get_enum ("hotcorner-bottomleft") != ActionType.NONE ? 1 : 0);
84
84
                                        ushort br_size = (schema.get_enum ("hotcorner-bottomright") != ActionType.NONE ? 1 : 0);
85
 
                                        
 
85
 
86
86
                                        X.Xrectangle topleft = {(short)geometry.x, (short)geometry.y, tl_size, tl_size};
87
87
                                        X.Xrectangle topright = {(short)(geometry.x + geometry.width - 1), (short)geometry.y, tr_size, tr_size};
88
88
                                        X.Xrectangle bottomleft = {(short)geometry.x, (short)(geometry.y + geometry.height - 1), bl_size, bl_size};
89
89
                                        X.Xrectangle bottomright = {(short)(geometry.x + geometry.width - 1), (short)(geometry.y + geometry.height - 1), br_size, br_size};
90
 
                                        
 
90
 
91
91
                                        rects = {topleft, topright, bottomleft, bottomright};
92
92
                                        break;
93
93
                                case InputArea.NONE:
102
102
                                        rects += rect;
103
103
                                }
104
104
                        }
105
 
                        
 
105
 
106
106
                        var xregion = X.Fixes.create_region (display.get_xdisplay (), rects);
107
107
                        Util.set_stage_input_region (screen, xregion);
108
108
                }