~ubuntu-branches/debian/sid/openbox/sid

« back to all changes in this revision

Viewing changes to openbox/focus.c

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2010-04-23 16:26:22 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100423162622-glbe2jvey10sdiff
Tags: 3.4.11.1-1
* New upstream release (Closes: #570441).
  - removed wrong use of test command in openbox-gnome-session leading
    to misbehaviour with gnome sessions (Closes: #566685).
* Add obxprop to the installed files (Closes: #564292).
* Removed 04_escape_session_names.dpatch/03_nextprev-xinerama.dpatch
  completely from debian/, wasn't used anymore anyway.
* Bump standards version, no changes needed.
* Update install files for libobparser/libobrender and links in openbox-dev
  as the shared library minor version changed.
* Update install paths of openbox-dev files to reflect upstream changes
  and install all header files rather than pick them manually.
* Switch to regular paragraphs from asterisks in NEWS file.
* Change short description of openbox-dev to differ from openbox.
* Switch to dpkg-source 3.0 (quilt) format
  - switch from dpatch to quilt patches.
* Adding ${misc:Depends} to openbox-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        push_to_top(client);
91
91
        /* remove hiliting from the window when it gets focused */
92
92
        client_hilite(client, FALSE);
 
93
 
 
94
        /* make sure the focus cycle popup shows things in the right order */
 
95
        focus_cycle_reorder();
93
96
    }
94
97
 
95
98
    /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */
198
201
        focus_order_to_top(c);
199
202
    else {
200
203
        g_assert(!g_list_find(focus_order, c));
201
 
        /* if there are any iconic windows, put this above them in the order,
 
204
        /* if there are only iconic windows, put this above them in the order,
202
205
           but if there are not, then put it under the currently focused one */
203
206
        if (focus_order && ((ObClient*)focus_order->data)->iconic)
204
207
            focus_order = g_list_insert(focus_order, c, 0);
206
209
            focus_order = g_list_insert(focus_order, c, 1);
207
210
    }
208
211
 
209
 
    /* in the middle of cycling..? kill it. */
210
 
    focus_cycle_stop(c);
 
212
    focus_cycle_addremove(c, TRUE);
211
213
}
212
214
 
213
215
void focus_order_remove(ObClient *c)
214
216
{
215
217
    focus_order = g_list_remove(focus_order, c);
216
218
 
217
 
    /* in the middle of cycling..? kill it. */
218
 
    focus_cycle_stop(c);
 
219
    focus_cycle_addremove(c, TRUE);
 
220
}
 
221
 
 
222
void focus_order_like_new(struct _ObClient *c)
 
223
{
 
224
    focus_order = g_list_remove(focus_order, c);
 
225
    focus_order_add_new(c);
219
226
}
220
227
 
221
228
void focus_order_to_top(ObClient *c)
231
238
             it && !((ObClient*)it->data)->iconic; it = g_list_next(it));
232
239
        focus_order = g_list_insert_before(focus_order, it, c);
233
240
    }
 
241
 
 
242
    focus_cycle_reorder();
234
243
}
235
244
 
236
245
void focus_order_to_bottom(ObClient *c)
246
255
             it && !((ObClient*)it->data)->iconic; it = g_list_next(it));
247
256
        focus_order = g_list_insert_before(focus_order, it, c);
248
257
    }
 
258
 
 
259
    focus_cycle_reorder();
249
260
}
250
261
 
251
262
ObClient *focus_order_find_first(guint desktop)
291
302
                            gboolean desktop_windows,
292
303
                            gboolean user_request)
293
304
{
 
305
    /* NOTE: if any of these things change on a client, then they should call
 
306
       focus_cycle_addremove() to make sure the client is not shown/hidden
 
307
       when it should not be */
 
308
 
294
309
    gboolean ok = FALSE;
295
310
 
 
311
    /* see if the window is still managed or is going away */
 
312
    if (!ft->managed) return FALSE;
 
313
 
296
314
    /* it's on this desktop unless you want all desktops.
297
315
 
298
316
       do this check first because it will usually filter out the most
327
345
                  that can be focused instead */
328
346
               !focus_target_has_siblings(ft, iconic_windows, all_desktops))));
329
347
 
330
 
    /* it's not set to skip the taskbar (but this only applies to normal typed
331
 
       windows, and is overridden if the window is modal or if the user asked
332
 
       for this window to be focused) */
333
 
    ok = ok && (ft->type != OB_CLIENT_TYPE_NORMAL ||
334
 
                ft->modal ||
335
 
                user_request ||
336
 
                !ft->skip_taskbar);
 
348
    /* it's not set to skip the taskbar (but this is overridden if the
 
349
       window is modal or if the user asked for this window to be focused,
 
350
       or if the window is iconified (and does not have any parents with
 
351
       which to uniconify it), and it is not used for windows which are
 
352
       hilited, or dialog windows as these need user interaction and should
 
353
       not be long-lasting windows */
 
354
    ok = ok && (!ft->skip_taskbar ||
 
355
                (ft->modal || user_request ||
 
356
                 (ft->iconic && !ft->parents) ||
 
357
                 ft->demands_attention ||
 
358
                 ft->type == OB_CLIENT_TYPE_DIALOG));
337
359
 
338
360
    /* it's not going to just send focus off somewhere else (modal window),
339
361
       unless that modal window is not one of our valid targets, then let