1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00
Commit Graph

61 Commits

Author SHA1 Message Date
Rodolfo García Peñas
d27ce03780 Remove warning by open coding WM_ITERATE_ARRAY macro
This patch gets rid of the warning:

switchpanel.c: In function 'wSwitchPanelSelectFirst':
switchpanel.c:673:18: warning: variable 'tmpwin' set but not used [-Wunused-but-set-variable]

by using the body of the WM_ITERATE_ARRAY directly and avoiding the temporary
variable 'tmpwin' which ends up being used only on the LHS inside the macro.
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
c610b8d7ce Variable current_workspace moved to workspace object in global namespace
The variable current_workspace, that contains the current workspace
is moved to the global workspace properties.

Now the screen is not needed to know the workspace_count.
2013-10-09 13:02:44 +01:00
Iain Patterson
e0697c9162 Fixed scoping error in wSwitchPanelSelectFirst().
We were using wwin as the temporary variable in WM_ITERATE_ARRAY() but
wwin was already set to the result of WMGetFromArray() and was due to be
returned from the function.  As a result of this oversight, wwin was
always set to NULL.

The bug could cause a problem in the - admittedly rare - case where all
windows were minimised at startup, causing the first invocation of the
switchpanel to highlight the first minimised window but then fail to
raise it.

Reported by Yury Tarasievich.
2013-10-02 12:23:28 +02:00
Christophe CURIS
ecfb2dc902 wmaker: Moved definition of WM-related XAtoms into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
74cd836e48 wmaker: Replaced local 'extern' definition of wPreferences by proper header usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-30 15:10:09 +01:00
Iain Patterson
3966cd2fc2 Don't crash when SwitchPanelImages is None.
The whole changeImage() function in switchpanel.c is a no-op if
wPreferences.swtileImage is set to None because the panel isn't actually
drawn in that case.  As a consequence there are no images to change.

As well as being logically incorrect the existing code causes a segfault
if the user has the SwitchPanelImages preference set to None because
changeImage() would attempt to access the icons and images arrays which
are only initialised in wInitSwitchPanel() when swtileImage has a value.

Bug report and diagnosis by Juan Giordana, Gabriel Vlasiu and Christophe
Curis.
2013-06-19 18:02:15 +01:00
Christophe CURIS
f0c1dc9fc3 wmaker: Added 'const' attribute to most local functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Iain Patterson
4c7d0025dd Compiler food.
WMArray elements are stored as pointers.  We only need to store chars
for switchpanel flags.
2013-06-07 19:52:53 +01:00
Iain Patterson
420fcb2819 Avoid unnecessary switchpanel icon redraws.
Keep an array of flags to remember if icons are supposed to be selected
and/or dimmed, and don't redraw any which are already in the correct
state.

Originally I didn't think the benefit of doing this was worth the effort
but future commits will call changeImage() more often so cutting down on
unnecessary redraws suddenly became more useful.
2013-06-07 18:43:21 +01:00
Iain Patterson
dd8d320619 Undim switchpanel icons when selecting windows directly.
If one or more icons were dimmed in the switchpanel because the user
used GroupNext/PrevKey, then an icon was selected with the mouse or the
Home or End keys, dimmed icons remained dim.  That could be unintuitive
if the selected window was of a different class.

Instead we now always redraw all icons when highlighting a different
icon.
2013-05-24 15:00:24 +01:00
Iain Patterson
89a6476a33 Dim switchpanel icons when same-class cycling.
When cycling through windows in the switchpanel using the GroupNextKey
or GroupPrevKey shortcuts, dim the icons of windows which are of a
different WM_CLASS.
2013-05-23 18:19:45 +01:00
Iain Patterson
94777b9715 Support for same-class cycling in open switchpanel.
If the switchpanel was opened with either FocusNextKey or FocusPrevKey
shortcut, and the user presses GroupNextKey or GroupPrevKey, skip over
windows of a different class when cycling through windows in the
switchpanel.

In the case where the switchpanel was opened with FocusNextKey or
FocusPrevKey initially, the check can be skipped because all the
available choices are necessarily of the same class already.
2013-05-02 20:41:07 +01:00
Iain Patterson
6fb2b13ec7 Added sameWindowClass().
Avoid code duplication by moving check for windows of the same WM_CLASS
to the new function sameWindowClass().
2013-05-02 20:41:07 +01:00
Rodolfo García Peñas (kix)
41da1b30db New file misc.h
This is the new file misc.h, with the function prototypes for misc.c.
This file is created using misc.c and removing the prototypes from funcs.h
2013-04-17 10:13:25 +01:00
Martin Frydl
914d4e06ef Added option to ignore minimized windows during cycling.
Added CycleIgnoreMinimized configuration option settable on Expert page in WPrefs.
When option is set, switch panel cycling ignores minimized (grayed) windows. They
are still visible and can be selected using left/right arrows or mouse click.
2012-11-28 00:07:13 +01:00
Rodolfo García Peñas (kix)
658597b889 wDefaultGetImage renamed to get_icon_image
The function wDefaultGetImage is renamed to get_icon_image.
2012-11-10 19:47:40 +00:00
Rodolfo García Peñas (kix)
af41673dbf Removed scaleDownIfNeeded function (dup code)
The function scaleDownIfNeeded's code is duplicated with the code of
wIconValidateIconSize(), then this function can be removed. The icon
size in the switchpanel should be ~48 pixels, to allow the frame around
the icon. Then, we always should resize the icon to this size. The standard
icon size is specified in WPreferences.icon_size (usually 64 pixels).
2012-07-16 02:06:36 +02:00
Rodolfo García Peñas (kix)
44c9ee694d switchpanel default icon removed
The default icon (defIcon) is never used because the function wDefaultGetImage
always returns a icon (it searches the default icon). So we can remove the
defIcon variable, its creation and remove code.
2012-07-15 16:28:02 +02:00
Rodolfo García Peñas (kix)
829830c010 New function create_default_icon
The function create_default_icon sets the panel's default icon. This
is interesting to have a "cache" icon and don't search the default
icon more than one time if the icons don't have icon associated.

The code of create_default_icon was included in the addIconForWindow()
function, this patch only moves it to get a better (clear) code.
2012-07-15 16:23:54 +02:00
Rodolfo García Peñas (kix)
6d08aa22d8 switchpanel.c code clean
Some code clean in the file switchpanel.c, like spaces, curly brackets,
tabs, join ifs,...
2012-07-15 16:22:19 +02:00
Rodolfo García Peñas (kix)
d6db53af0b Remove unused argument from wDefaultGetIconFile()
The function wDefaultGetIconFile() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:44:40 +02:00
Tobias Stoeckmann
cc30444dda No need to call memset after wmalloc
memset is the last function call in wmalloc, just before it returns the
newly allocated memory.  Therefore it is not needed to call it again
after wmalloc call.  Although I would prefer to switch wmalloc to a
calloc-based wcalloc function, the compatibility of WINGs for old apps
should be kept.
2012-05-04 18:41:01 -03:00
Rodolfo García Peñas (kix)
528d97b597 canReceiveFocus() should check no_focusable first
The function canReceiveFocus should check if the window is no_focusable first.

If the window is not focusable but is miniaturized, the window is shown in the
switchpanel.

How to reproduce the problem:

- Open an application
- Open the window properties, advanced options
- Set that the application can not get the focus and save
- Test the switchpanel (Alt+Tab) the window doesn't appear
- Minimize the window
- Test the switchpanel (Alt+Tab), the window appears
- If the window is selected (restored), and test again the switchpanel, the window doesn't appear!
2012-04-04 11:49:23 +01:00
Rodolfo García Peñas (kix)
aab9028fc2 Coding-style cleanup
Code style cleanup in multiple files. Tabs, spaces, curly brackets,...
2012-03-30 19:50:10 +01:00
Iain Patterson
07a0639c93 Don't shrink icons in switchpanel.
Icons in the switchpanel are constrained to the value of the IconSize
preference but the grid in which they are arranged is fixed at 64 pixels.
If IconSize is less than 64x64 the panel will show smaller icons with a
wide spacing, which looks pretty stupid.

Fix it by forcing the switchpanel to attempt to load images at the size
it's going to use.  The icon it actually gets may of course still be
smaller.
2012-02-16 09:13:01 +00:00
Haroldo Santos
c82138eab9 switchpanel: Add skip_switchpanel advanced option
Some applications running in my machine are only background
windows, e.g.: screenlets showing CPU usage.

In current wmaker version all these applications pollute my
switchpanel, so I wrote this patch (thanks Carlos for the helping me).

It includes an additional advanced option for windows "Do not
include in switchpanel" which, if set, allows applications to
not appear in the switchpanel.

Signed-off-by: Haroldo Santos <haroldo.santos@gmail.com>
2011-02-17 19:29:15 +01:00
Andrea Gelmini
7c14c0b14a Remove duplicated #includes 2010-11-29 11:59:22 +01:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Carlos R. Mafra
4041278f48 Address some sparse warnings
Plain integer as NULL pointer, non-ANSI function declaration etc.
2010-04-14 18:39:17 +02:00
Carlos R. Mafra
fb91e5d67a Do not skip windows in the switchpanel
If a window has the skip_window_list flag set wmaker currently not only skips
this window from the window list (F11) but also from the switchpanel (TAB).

This patch makes skip_window_list-windows appear in the switchpanel and be
skipped only in the window list, strictly honoring what the name of the flag
is supposed to mean.

The motivation for this is that I have lots of workspaces and almost all of
them has a xterm, so that I set the skip_window_list for the xterms not to
overcrowd the window list. But I still want to alt+TAB to xterms on the current
workspace.

In addition to that, now the "internal window" flag is not checked before
appearing in the switchpanel.
2010-04-08 18:38:37 +02:00
Tamas TEVESZ
b59575e709 Add new cycling option
When using Xinerama, make it possible only to cycle between those
windows that are on the currently active head - AFAICT this means
windows that have the majority of their area on the same head as
the pointer.

Patch complete with WPrefs integration, alas this being quite
unusable - for a lack of a better idea, I tucked the option on the
expert panel, making the item list too tall - making it scrollable
would be a nice addition.

The default for the new option (CycleActiveHeadOnly) should be NO,
that is, no change in default behaviour.
2010-04-08 15:53:50 +02:00
Carlos R. Mafra
e1d5ce7a51 Cleanup includes of wcore.h, defaults.h and pixmap.h
Several files were including others for no reason, and this slows
down the build time (but probably not measurable on a fast machine).
2010-03-17 11:12:53 +01:00
Carlos R. Mafra
2ba803ad98 Remove unused arguments from a few functions
gcc 4.4.1 was warning (among others):

switchpanel.c: In Funktion »getTile«:
switchpanel.c:321: Warnung: unbenutzter Parameter »panel«
switchpanel.c: In Funktion »makeWindowListArray«:
switchpanel.c:377: Warnung: unbenutzter Parameter »scr«
switchpanel.c:377: Warnung: unbenutzter Parameter »workspace«
2009-12-09 21:04:29 +01:00
Iain Patterson
18408fff93 Mac OS X-style window cycling.
For those not familiar with the way Macs cycle windows, the Command-Tab
sequence (Alt-Tab elsewhere) switches between DIFFERENT application windows
and Command-Grave (key above tab) switches between windows owned by the
SAME application as is currently focused.  So if you had three Safari and
two Finder windows open, and Safari had focus, Command-Tab would switch to
Finder; Command-Tab would switch back to Safari; Command-Grave would switch
to a different Safari window etc.

This patch implements "something like" the above by only populating the
switchpanel with windows matching the currently-focused WWindow's wm_class
when the new cycling mode is activated.  In practice this means you can
switch to The Next XTerm or The Next Firefox Window using this method.

The configuration names for these new shortcuts are GroupNext and
GroupPrev.  The patch tells WPrefs.app about them.  Of course switching to
The Next Window is still possible with the (unchanged) FocusNext and
FocusPrev keys.
2009-09-14 16:51:26 +02:00
Daniel Déchelotte
3f7110b120 Fix focus issues with the switch panel and auto-focus
1. Setup two windows in a workspace, one at the center and the
   other at a corner. Move the mouse to the center of the screen, so
   that the focus goes to the center window. Now, with the help of the
   keyboard (with Alt-tab, typically), try and switch the focus to the
   other window. In doing so, the switch panel shows up, gives the
   focus to the other window and then disappears. However, its
   disappearance make it seem to wmaker that the mouse has just
   entered the center window, so wmaker gives the focus to that
   window again.

   2. It is a lit bit more involved. "Raise window when switching
   focus with keyboard" needs to be set. In a given workspace, maximize
   a first window A, then setup "above" window A two windows B and C
   (one in the upper left corner and the other one in the lower right
   corner, for example). Move the mouse so as to give the focus to
   window B. Press the Alt key, hit the key tab once (window A moves
   up to the "top"), then another time (window C is then selected).
   Eventually relase the Alt key: window B is given the focus again.

Correction: it is a matter of ignoring some (EnterNotify) events
when the switch panel is active or has just been used.
2009-08-20 22:07:10 +02:00
Carlos R. Mafra
688a56e8ab Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)
2009-08-20 00:59:40 +02:00
Iain Patterson
bbc52564d0 xinerama switchpanel corruption fix
This is a small patch to fix an issue with the switchpanel and a large number
of windows which happens only on a Xinerama setup.

When the number of open windows is so large that displaying all of them would
cause the switchpanel to be too wide for the screen, the panel is supposed to
shrink and scroll to accomodate them all.

In Window Maker 0.92.0 this works for single head displays but not for
Xinerama. The panel extends to the next head and gets garbled. This patch fixes
the issue by correctly constraining the panel to the head with the cursor.

Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
2009-08-16 00:06:31 +02:00
dan
bacf8229b0 - release colors to avoid issues with the reference count overflowing a
small integer and causing unexpected color releases that can crash
  Window Maker (Martin Frydl <martin.frydl@systinet.com>)
- fixed a small memory leak in WINGs/wview.c caused by not releasing the
  background color of a view (Martin Frydl <martin.frydl@systinet.com>)
2006-01-22 18:19:09 +00:00
dan
e53ddd046f fixed another spot where compiling on solaris with openwin generated errors 2004-10-30 07:17:49 +00:00
kojima
d63a0b4859 added option to disable switchpanel
fixed some bugs
2004-10-27 02:54:32 +00:00
kojima
2ea68b8d2b changed alt-tab behaviour 2004-10-26 17:55:34 +00:00
kojima
92a84fe050 fixed crash bug with alt-tab + run-dialog (or internal windows in general) 2004-10-26 08:00:19 +00:00
kojima
087a16400f updated Makefiles files for po dirs 2004-10-26 01:11:15 +00:00
kojima
12b8b8ba58 bug fix 2004-10-25 00:42:25 +00:00
kojima
f274afdd1d added themable, pixmap background switch panel 2004-10-25 00:07:51 +00:00
kojima
df1228f387 added some netwm support in WINGs 2004-10-23 21:07:13 +00:00
kojima
11b464a002 fix flicker 2004-10-23 01:56:24 +00:00
kojima
663df7b4cb enhacnced mouse alt-tabbing 2004-10-23 01:02:16 +00:00
kojima
b034bb077f added mouse seelction of window to focus 2004-10-22 22:57:14 +00:00
kojima
f6682a9ade fixed bugs, re-enabled circulate raise 2004-10-20 03:31:14 +00:00