~muktupavels/metacity/adwaita-icon-theme-lp-1414613

« back to all changes in this revision

Viewing changes to src/ui/draw-workspace.c

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2014-11-18 18:13:01 UTC
  • mfrom: (1.4.1) (2.5.4 sid)
  • mto: This revision was merged to the branch mainline in revision 135.
  • Revision ID: package-import@ubuntu.com-20141118181301-cgqtucqg732irm9x
* Merge with Debian unstable, remaining changes:
  - 05_raise_on_click_for_click_mode.patch:
    Force raise on click option.
  - 22_fix_above_tab_switching.patch:
    For Above_Tab, don't compare keysym (fixes group switching).
  - debian/metacity-common.links:
    Show keybindings in Unity control center.
  - Use Ubuntu Desktop team Vcs fields.
* Drop all other patches, they were needed only for Unity 2D.
* New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * libwnck or metacity, since it's used in both of them
7
7
 */
8
8
 
9
 
/* 
 
9
/*
10
10
 * Copyright (C) 2002 Red Hat Inc.
11
 
 * 
 
11
 *
12
12
 * This program is free software; you can redistribute it and/or
13
13
 * modify it under the terms of the GNU General Public License as
14
14
 * published by the Free Software Foundation; either version 2 of the
18
18
 * WITHOUT ANY WARRANTY; without even the implied warranty of
19
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
20
 * General Public License for more details.
21
 
 * 
 
21
 *
22
22
 * You should have received a copy of the GNU General Public License
23
23
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
24
24
 */
35
35
{
36
36
  double width_ratio, height_ratio;
37
37
  int x, y, width, height;
38
 
  
 
38
 
39
39
  width_ratio = (double) workspace_rect->width / (double) screen_width;
40
40
  height_ratio = (double) workspace_rect->height / (double) screen_height;
41
 
  
 
41
 
42
42
  x = win->x;
43
43
  y = win->y;
44
44
  width = win->width;
45
45
  height = win->height;
46
 
  
 
46
 
47
47
  x *= width_ratio;
48
48
  y *= height_ratio;
49
49
  width *= width_ratio;
50
50
  height *= height_ratio;
51
 
  
 
51
 
52
52
  x += workspace_rect->x;
53
53
  y += workspace_rect->y;
54
 
  
 
54
 
55
55
  if (width < 3)
56
56
    width = 3;
57
57
  if (height < 3)
99
99
  icon = win->icon;
100
100
 
101
101
  icon_w = icon_h = 0;
102
 
          
 
102
 
103
103
  if (icon)
104
 
    {              
 
104
    {
105
105
      icon_w = gdk_pixbuf_get_width (icon);
106
106
      icon_h = gdk_pixbuf_get_height (icon);
107
107
 
117
117
            {
118
118
              icon_w = gdk_pixbuf_get_width (icon);
119
119
              icon_h = gdk_pixbuf_get_height (icon);
120
 
        
 
120
 
121
121
              /* Give up. */
122
122
              if (icon_w > (winrect->width - 2) ||
123
123
                  icon_h > (winrect->height - 2))
130
130
    {
131
131
      icon_x = winrect->x + (winrect->width - icon_w) / 2;
132
132
      icon_y = winrect->y + (winrect->height - icon_h) / 2;
133
 
      
 
133
 
134
134
      cairo_save (cr);
135
135
      gdk_cairo_set_source_pixbuf (cr, icon, icon_x, icon_y);
136
136
      cairo_rectangle (cr, icon_x, icon_y, icon_w, icon_h);
138
138
      cairo_paint (cr);
139
139
      cairo_restore (cr);
140
140
    }
141
 
          
 
141
 
142
142
  gtk_style_context_get_color (style, state, &color);
143
143
  gdk_cairo_set_source_rgba (cr, &color);
144
144
  cairo_set_line_width (cr, 1.0);
146
146
                   winrect->x + 0.5, winrect->y + 0.5,
147
147
                   MAX (0, winrect->width - 1), MAX (0, winrect->height - 1));
148
148
  cairo_stroke (cr);
149
 
  
 
149
 
150
150
  cairo_restore (cr);
151
151
}
152
152
 
176
176
 
177
177
  if (is_active)
178
178
    state = GTK_STATE_FLAG_SELECTED;
179
 
  else if (workspace_background) 
 
179
  else if (workspace_background)
180
180
    state = GTK_STATE_FLAG_PRELIGHT;
181
181
  else
182
182
    state = GTK_STATE_FLAG_NORMAL;
206
206
    {
207
207
      const WnckWindowDisplayInfo *win = &windows[i];
208
208
      GdkRectangle winrect;
209
 
      
 
209
 
210
210
      get_window_rect (win, screen_width,
211
211
                       screen_height, &workspace_rect, &winrect);
212
 
      
 
212
 
213
213
      draw_window (widget,
214
214
                   cr,
215
215
                   win,
216
216
                   &winrect,
217
217
                   state);
218
 
      
 
218
 
219
219
      ++i;
220
220
    }
221
221