summaryrefslogtreecommitdiffstats
path: root/doc/userguide/windows-how-to.docbook
blob: 914e228da093199add288b35f843f28b6728aacf (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
<sect1 id="windows-how-to-work">
<sect1info>
<authorgroup>
<author>
&Philip.Rodrigues;
</author>
</authorgroup>
</sect1info>


<title>Windows, How To Work Them</title>

<sect2 id="basic-window-management">
<title>Basic Window Management</title>
<indexterm><primary>Window Management</primary></indexterm>

<para>Each application running in &kde; has its own window, and some
applications may use more than one window. You can manipulate these
windows in many ways to make your desktop work for you. Here is a
normal window:
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="a-window.png" format="PNG"/>
</imageobject>
<textobject><phrase>A normal window</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>

<sect3 id="switching-between-windows">
<title>Switching Between Windows</title> 
<indexterm><primary>Focus (windows)</primary></indexterm>

<para>If you want to use a window, it must be active. A window
automatically becomes active when you open it, so that the application
you opened is immediately ready to use. Only one window can be active
at a time. The active window is the one into which you can type, and can
be distinguished from the others because it has a different colored
titlebar. (With the &kde; default theme, the active window has a
<replaceable>light blue</replaceable> titlebar, and the inactive
windows have <replaceable>gray</replaceable> titlebars.)</para>

<para>
<indexterm><primary>Raising Windows</primary></indexterm>
When you want to work in a different window, you need to make
it active. There are two ways to do this:
<itemizedlist>

<listitem>
<para>&LMB;-click on the window that you want to make active. The
window will become active and will be raised above other windows if it
overlaps them.</para>
</listitem>

<listitem>
<para><indexterm><primary><keycombo
action="simul">&Alt;&Tab;</keycombo></primary></indexterm>
Hold down &Alt; and press &Tab; (do not release the &Alt;
key). A popup dialog appears with a list of available windows, one of
which is highlighted. You can select a different window by pressing
&Tab; again to move through the list, all the time holding down
&Alt;. When you release the &Alt; key, the window which was highlighted
is made active.</para>
</listitem>
</itemizedlist>
</para>

</sect3>

<sect3 id="moving-windows">
<title>Moving Windows</title>
<indexterm><primary>Moving Windows</primary></indexterm>

<para>The first way to organize the windows on your desktop is to move
them around. You can move windows so that they overlap other windows,
or so that you can see the whole window. There are three ways to move
a window:
<itemizedlist>
<listitem>
<para>Click the &LMB; on the window titlebar and hold it down. Move
the mouse cursor and the window moves with it. Release the mouse
button, and the window remains where you left it.</para>
</listitem>

<!-- FIXME:  OK, so the screenie sucks, but it shows the idea --> 
<!-- In fact, maybe it's not even necessary: just mention the previous -->
<!-- screenshot (having callouts on it would be nice) -->

<listitem>
<para>Open the window menu using the leftmost button on the window
titlebar (as displayed below), and select <guimenuitem>Move</guimenuitem>. The mouse cursor
moves to the center of the current window and by moving the mouse
around, you can move the window. Once you have moved the window to the
position you want, click the &LMB; to release it.</para>
<indexterm><primary>Window Menu</primary></indexterm>

<screenshot>
<screeninfo>The Window Menu</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="titlebar-menu.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The Window Menu</phrase>
</textobject>
</mediaobject>
</screenshot>
</listitem>

<listitem>
<para>Hold down &Alt; and the &LMB; when the mouse cursor is
above the window you want to move. The mouse cursor changes to a
compass, and by moving the mouse, you can move the window. Just
release the mouse button to release the window. This method is
particularly useful if the window titlebar has been moved off the
screen, so you cannot use the other methods.</para>
</listitem>
</itemizedlist>
</para>

</sect3>

<sect3 id="resizing-windows">
<title>Resizing Windows</title>

<indexterm><primary>Resizing Windows</primary></indexterm>

<para>You can make windows bigger or smaller, wider, or taller in
one of two ways. Just use whichever you are most comfortable with:
<itemizedlist>
<listitem>
<para>Move the mouse cursor over the border of the window (it is light
blue in the screenshot above). The pointer will turn into a
double-headed arrow. Click and drag, and the edge of the window
follows the mouse cursor, making the window bigger or smaller. If you
click on the borders on the top or bottom of the window, you can
adjust the height on its own. If you click on the borders on the left
or right of the window, you can adjust the width. To change both at
the same time, move the mouse cursor over the corner of the
window. When the pointer becomes a diagonal double-headed arrow, click
and drag.</para>
</listitem>
<listitem>
<para>Use the leftmost button on the window titlebar to display the
window menu. Choose the <guimenuitem>Resize</guimenuitem> entry, and
the mouse pointer will become a double-headed arrow. Move the mouse
cursor around to resize, and click the &LMB; when you are done 
to release the window.</para>
</listitem>
<listitem>
<para>If you cannot see the window border or the button for the window
menu, you can use &Alt; and the &RMB;: Hold down &Alt; and drag with
the &RMB;. The window will resize. You just release the &RMB; when
you are done. </para>
</listitem>
</itemizedlist>
</para>

<para>If you just want to make a window as big as possible, so it
takes up the whole screen, use the
<guibutton>Maximize<indexterm><primary>Maximizing
Windows</primary></indexterm></guibutton> button, which is the second
button from the right on the window titlebar. Clicking with the &LMB;
on this button will make the window as big as possible in both
directions; while clicking with the &MMB;<indexterm><primary>Maximizing
Windows</primary><secondary>Vertically</secondary></indexterm> or the
&RMB;<indexterm><primary>Maximizing Windows</primary><secondary>Horizontally</secondary></indexterm>
will increase the window's size in only the vertical or horizontal
direction, respectively.</para>


</sect3>

<sect3 id="hiding-windows">
<title>Hiding Windows</title>
<indexterm><primary>Hiding Windows</primary></indexterm>

<!-- TODO: Screenshot of the minimize button -->
<para>
<indexterm><primary>Minimize</primary></indexterm>
When you need to keep a program open, but you do not want it to
take up space on your desktop, you can minimize it or shade it. To
minimize a window, click the <guibutton>Minimize</guibutton> button,
which is third from the right on the window titlebar. The window will
not be displayed, but the program is still running, and an entry for
it appears in the taskbar on the panel. To display the window again,
click on its entry in the taskbar. You can also use <keycombo
action="simul">&Alt;&Tab;</keycombo><indexterm><primary><keycombo
action="simul">&Alt;&Tab;</keycombo></primary></indexterm>: see <xref
linkend="switching-between-windows" />.</para>

<para>
<indexterm><primary>Shade</primary></indexterm>
Shading windows is very similar to minimizing them, but this
time, only the titlebar of the window is shown. To shade a window,
double-click on the titlebar. To restore the window, just double-click
on the titlebar again.</para>
</sect3>

<sect3 id="cascade-windows">
<title>Cascading Windows</title>

<para>Sometimes you might have a whole lot of windows open and all over the place. By selecting to cascade windows &kde; will automatically line them up as a succession from the top-left of your screen. To use this option use your &MMB; on the desktop, and then select <guimenuitem>Cascade Windows</guimenuitem>.</para>

</sect3>

<sect3 id="unclutter-windows">
<title>Uncluttering Windows</title>

<para>By selecting to unclutter your opened windows &kde; will attempt to use the maximum available space of the desktop in order to display as much of each window as possible. For example, should you have four windows open and you request that they be uncluttered, they will each be placed in a corner of the desktop, regardless of where they were originally. To use this option once again use your &MMB; on the desktop and then select <guimenuitem>Unclutter Windows</guimenuitem>.</para>

</sect3>

<sect3 id="closing-windows">
<title>Closing Windows</title>

<indexterm><primary>Closing Windows</primary></indexterm>

<para>When you finish using an application, you will want to stop
the application and close its window.  Once again, you have the choice
of a few options:
<itemizedlist>
<listitem>
<para>Click on the rightmost button on the window titlebar.<!-- TODO: -->
<!-- Screenie --> If you are editing a document with that application,
you will be asked whether you want to <guibutton>Save</guibutton> your
changes, <guibutton>Discard</guibutton> them, or
<guibutton>Cancel</guibutton> your command to close the application.</para>
</listitem>
<listitem>
<para>Use the <menuchoice><guimenu>File</guimenu><guimenuitem>Quit</guimenuitem>
</menuchoice> option on the menubar. You will be presented with the
same choice of <guibutton>Save</guibutton>,
<guibutton>Discard</guibutton>, or
<guibutton>Cancel</guibutton>.</para>
</listitem>

<listitem>
<para> <mousebutton>Right</mousebutton>-click on the respective window in &kicker;, the &kde; panel, and then select <guimenuitem>Close</guimenuitem>. You will be prompted with an option to save any documents that were being edited.</para>
</listitem>

<listitem>
<para>Press <keycombo action="simul">&Alt;<keycap>F4</keycap></keycombo><indexterm><primary><keycombo action="simul">&Alt;<keycap>F4</keycap>
</keycombo></primary></indexterm>
. Once again, the confirmation dialog will be shown if you
were editing any documents.</para>
</listitem>
</itemizedlist>
</para>

</sect3>

<!-- Let's try organising this a different way
<para>The bar along the top is called the titlebar, and contains most
of the things you'll need to manipulate the window. Let's take a
closer look:
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="titlebar.png" format="png"/>
</imageobject>
<textobject><phrase>A window titlebar</phrase>
</textobject>
</mediaobject>
</screenshot>
<note><para>This screenshot shows the titlebar which appears in the
default &kde; configuration. The exact appearance on your system may
be slightly different, but the functions are similar.</para>
</note>
-->

<!-- TODO:Note &MMB; mouse button/&RMB mouse button on maximize for
vertical/horizontal maximization. Or is this advanced? -->

</sect2>

<sect2 id="advanced-window-management">
<title>Advanced Window Management</title>

<para>kstart</para>
<sect3 id="kstart">
<sect3info>
<author>
&Richard.J.Moore;
&Richard.J.Moore.mail;
</author>
</sect3info>
<title>&kstart;</title> 

<para>The simplest way to access the advanced window management
facilities in &kde; is to use a little known
utility called  &kstart;, which is included in &kde; since version 2.1 &kstart; lets you control the way an application interacts with
the window manager. The command is usually
used to define special behavior for commonly-used applications, but
it can also be useful for integrating non-&kde; applications into your
desktop.</para>

<para>Using &kstart; is easy: you simply put
<userinput><command>kstart</command></userinput> and some options
before a command. To begin, let's look at how we might use
&kstart; to customize the behaviour of a
&kcalc; window.  The command we'll use is as follows:

<screen><prompt>%</prompt> <userinput><command>kstart</command> <option>--ontop</option> <option>--alldesktops</option> <option>kcalc</option></userinput></screen>
</para>

<para>With luck, the effect this command has
should be fairly obvious - the kcalc window will stay on top of all
the others and be visible on every virtual desktop. A feature that is
less obvious is that this command will work with any NET compliant
environment, not just &kde;.</para>

<para>We can pass arguments to programs we invoke with &kstart; as normal, for
example:

<screen><prompt>%</prompt> <userinput><command>kstart</command>
<option>--skiptaskbar</option> <option>--desktop</option>
1 xmessage'Hello World'</userinput></screen>

</para>

<para>This command displays <computeroutput>Hello
World</computeroutput> with <application>xmessage</application> and
ensures that the window will be shown on the first virtual desktop and
will be omitted from the taskbar. The fact that this program is
written using the Xt toolkit rather than being a native &kde;
application does not cause any problem for
&kstart;, hopefully this illustrates how
&kstart; can be used to integrate foreign
applications into your &kde; desktop.</para>
</sect3>

<sect3 id="special-window-settings">
<title>Other Special Window Settings</title>
<para>While you can use &kstart; to assign particular window settings, &kde; also allows you to alter these -- as well as other similar settings -- from the program window itself. Simply select the leftmost button in the window titlebar (or just hit <keycombo action="simul">&Alt;<keycap>F3</keycap></keycombo> once the window is focued), and then go to <menuchoice><guisubmenu>Advanced</guisubmenu><guimenuitem>Special Window Settings...</guimenuitem></menuchoice>. As you can see, from here you change various things from its geometry upon startup, to whether it should have a border or not.</para>
</sect3>

<sect3 id="system-tray">
<sect3info>
<author>
&Richard.J.Moore;
&Richard.J.Moore.mail;
</author>
</sect3info>

<title>The System Tray</title>

<para>Now that we know how to customize the decoration of a window
let's take a look at another aspect of the desktop: the system
tray. The system tray is an area in which an application can display a
small window. It is used to display status information or provide
quick access to commands. A window that has an item in the system tray
usually disappears from the task manager when minimised with the tray
icon providing a replacement. Normally tray icons are specifically
developed as part of an application, but as with window decorations,
&kde; provides a tool for changing this:
<application>ksystraycmd</application>.</para>

<para>To begin with, we'll take the standard application &kcalc; and turn
it into a system tray application. This is acheived with one simple
command:
<screen><prompt>%</prompt> <userinput><command>ksystraycmd</command> <option>--title</option> 'kcalc' kcalc</userinput></screen>

</para>

<para>The icon shown in the tray is the one specified in the window
hints and will be updated if the icon changes.  The window title is
shown as a tooltip if you hold the mouse over the icon.
<application>ksystraycmd</application> follows standard &kde;
behaviour so the target window can be shown and hidden by clicking the
tray icon, and a standard context menu is available. </para>

<screenshot> <mediaobject> <imageobject><imagedata
fileref="kcalc-systray.png"></imagedata></imageobject>
</mediaobject></screenshot>
</sect3>

<sect3 id="more-complex-uses-of-ksystraycmd">
<sect3info>
<author>
&Richard.J.Moore;
&Richard.J.Moore.mail;
</author>
</sect3info>

<title>More Complex Uses of
<application>ksystraycmd</application></title>

<para>To illustrate the other features of
<application>ksystraycmd</application>, we'll use a more complicated example: a &konsole; window tracking the
<filename>.xsession-errors</filename> file (this is the log file that records what's
happening on your desktop).  To begin with, we'll simply look at how
we can view this:
<screen><prompt>%</prompt> <userinput><command>konsole</command> <option>--icon</option>
log <option>--caption</option> 'X Log' \ 
<option>--nomenubar</option> <option>--notabbar</option>
<option>--noframe</option> \ 
<option>-e</option> tail -f ~/.xsession-errors</userinput></screen>
</para>

 <para>The <option>--caption</option> and <option>--icon</option>
arguments are provided as standard by &kde; applications. You can get
a full list of these global options by running an application with the
<option>--help-kde</option> and <option>--help-qt</option>
parameters. Here we give our &konsole; window the title 'X Log' and
the icon <quote>log</quote>. You can use these options with any &kde; application and
as  mentioned above, <application>ksystraycmd</application> takes account of these when creating
the tray icon. The <option>-e</option> argument is specific to &konsole; and tells it
to run the <command>less</command> command. Despite its complexity, we can easily move
this window into the tray with <application>ksystraycmd</application>: 

<screen><prompt>%</prompt> <userinput><command>ksystraycmd</command>
<option>--hidden</option> <option>--title</option> 'X Log' \
konsole --icon log --caption 'XLog' \ 
--nomenubar --notabbar --noframe \ 
-e tail -f .xsession-errors</userinput></screen>
</para>

 <para>In addition to being the
most complex command we've used, this example demonstrates the
<option>--hidden</option> option which starts the command with only the system tray
icon visible. This example achieves our aim of providing quick access
to the log file, but we can do things a little more efficiently if we
only run the konsole process when it is visible. The command we use
is
<screen><prompt>%</prompt> <userinput><command>ksystraycmd</command> <option>--startonshow</option> \
 --<option>icon</option> log <option>--tooltip</option> 'X Log' \ 
konsole --icon log --caption 'X Log' \
--nomenubar --notabbar --noframe \
-e tail -f ~/.xsession-errors</userinput></screen>
</para>

<para>The addition of the <option>--startonshow</option> parameter tells
<application>ksystraycmd</application> to start with only the tray
icon visible (like the <option>--hidden</option> parameter), and to wait until the user
activates the tray icon before running the target command. We've also
used the <option>--quitonhide</option> parameter which tells <application>ksystraycmd</application> to terminate
the target app whenever its window is hidden. Using both these
parameters ensures that our &konsole; tray icon doesn't waste resources
when we aren't using it.  Creating and destroying the target window as
we do here prevents the standard icon and title handling of
<application>ksystraycmd</application> from working, so we now need to
specify the initial icon and tooltip explicitly
too.</para>
</sect3>

<sect3 id="improving-reliability">
<sect3info>
<author>
&Richard.J.Moore;
&Richard.J.Moore.mail;
</author>
</sect3info>

<title>Improving Reliability</title>

<para>In all of our previous examples we've relied on
&kstart; and
<application>ksystraycmd</application> to figure out which window we
want to affect, and unless we say otherwise, they assume that the first
window to appear is the one we want. This policy is usually OK because
we are starting the application at the same time, but it can fail
badly when lots of windows are appearing (such as when you log on). To
make our commands more robust we can use the
<option>--window</option> parameter. This specifies the title
of the target window. The following example uses the <option>--window</option> parameter
to ensure that a particular konsole window is affected:

<screen><prompt>%</prompt> <userinput><command>kstart</command> <option>--iconify</option> <option>--window</option> 'kstart_me' konsole
--caption 'kstart_me' -e tail -f
~/.xsession-errors</userinput></screen>

</para>

<para>Here we've used the tried and tested technique of specifying a
title for both &kstart; and the target application. This is generally
the best way to use &kstart; and <application>ksystraycmd</application>. The <option>--window</option> argument is
supported by both &kstart; and <option>ksystraycmd</option> and can be regular expression
(&eg; <quote>window[0-9]</quote>) as well as a particular title. (Regular
expressions are a powerful pattern matching tool you'll find used
throughout &kde;.) </para>

</sect3>

</sect2>

<sect2 id="using-multiple-desktops">
<title>Using Multiple Desktops</title>

<indexterm><primary>Virtual Desktops</primary></indexterm>
<indexterm><primary>Multiple Desktops</primary></indexterm>

<para>Sometimes, one screen's worth is just not enough space. If you
use many applications at the same time, and find yourself drowning in
different windows, virtual desktops offer the solution. By default,
&kde; has four virtual desktops, each one of which is like a separate
screen: you can open windows, move windows around, and set backgrounds and
icons on each of the desktops. If you are familiar with the concept of
virtual terminals, you will have no trouble with &kde;'s virtual
desktops.</para>

<sect3 id="switching-virtual-desktops">
<title>Switching Virtual Desktops</title>
<para>To move to a different virtual desktop, you can use <keycombo action="simul">&Ctrl;&Tab;
</keycombo> in the same way as you would use <keycombo action="simul">&Alt;&Tab;
</keycombo> to switch between windows (see <xref linkend="switching-between-windows"/>): Hold down &Ctrl; and then press
&Tab;. A small popup window appears, showing the virtual desktops,
with one highlighted. If you release &Ctrl;, &kde; will switch to the
highlighted virtual desktop. To select a different desktop, press
&Tab; repeatedly, while holding down &Ctrl;. The selection moves
through the available desktops. When the desktop you want to switch to
is highlighted, release &Ctrl;.</para>

<!-- TODO: Write about the desktop pager thing -->

</sect3>

<sect3 id="windows-and-virtual-desktops">
<title>Windows and Virtual Desktops</title>
<para>You can move windows around your virtual desktops with the
<guisubmenu>To Desktop</guisubmenu> item in the window menu: just
select the desktop to which you want to move the window. You can make the
window appear on all desktops with the <guimenuitem>All
Desktops</guimenuitem><indexterm><primary>Sticky
Windows</primary></indexterm> item.</para>

<!-- Add links to "further reading" here 
<itemizedlist>
<title>Related Information</title>
<listitem><para></para>
</listitem>
</itemizedlist>

-->
</sect3>


</sect2>

</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:0
sgml-indent-data:true
sgml-parent-document:("index.docbook" "book" "sect1")
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->