Andreas Bierfert [Sun, 10 Feb 2013 09:56:20 +0000 (10 10:56 +0100)]
Add OPEN_PLMENU option to parse command generated proplist style menus
This patch adds the OPEN_PLMENU options which behaves similar to OPEN_MENU but
can be used to parse command generated proplists. This can be used e.g. in
conjunction with wmmenugen like:
(
"Generated PL Submenu",
OPEN_PLMENU,
"|| find /usr/share/applications -type f -name '*desktop' | xargs
wmmenugen -parser:xdg"
)
v2: code cleanup
Andreas Bierfert [Thu, 31 Jan 2013 21:44:28 +0000 (31 22:44 +0100)]
WINGS: New function WMReadPropListFromPipe
This functions reads a proplist from a pipe instead of a file (like
WMReadPropListFromFile does). It uses a call to popen to open the desired
command, reads data into a buffer till EOF and passes the data to getPropList
for parsing.
v2: code cleanup
BALATON Zoltan [Fri, 8 Feb 2013 17:41:02 +0000 (8 18:41 +0100)]
WPrefs: Fix single click activation button in Icon preferences
Forgot to connect the button to the corresponding defaults key so it
was not working properly.
Carlos R. Mafra [Thu, 31 Jan 2013 01:00:42 +0000 (31 01:00 +0000)]
wmgenmenu: Add XBMC entry
Rodolfo García Peñas (kix) [Thu, 24 Jan 2013 23:59:08 +0000 (25 00:59 +0100)]
Sanitize 'Ignore client supplied icon' logic
There can be these 4 situations:
1. ignore flag + file set
2. no ignore flag + file set
3. ignore flag + no file set
4. no ignore flag + no file set
If the "ignore client supplied icon flag" is not set it means the user wants to use the client-provided icon,
so the eventual file name which might be in the entry field is ignored.
If the user sets the ignore flag and sets the icon name all is fine and Option 1 is done.
If the user tries to set an icon (ignore flag is set) but the file textbox is not set we show the
warning:
"Ignore client supplied icon is set, but icon filename textbox is empty. Using client supplied icon"
and use the client-supplied icon instead.
Wade Berrier [Sat, 26 Jan 2013 07:00:36 +0000 (26 00:00 -0700)]
autoconf: add remaining parameter for AC_SEARCH_LIBS
According to:
http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Libraries.html
Found this while trying to compile for RHEL6. Otherwise, configure
failed.
Rodolfo García Peñas (kix) [Tue, 22 Jan 2013 20:18:15 +0000 (22 21:18 +0100)]
Simplify the application appicon creation
This patch removes all the appicon stuff from the application creation
to the appicon creation. Now, the application only calls one function
(create_appicon_for_application()) and this function do all the work.
The function do the same code than the code before this patch, but the
only change is that the "if" test to check if the appicon was found in
the docks now is negated, removing the return and doing the appicon_save
inside the function.
Finally, the old makeAppIconFor is now create_appicon_for_application().
Rodolfo García Peñas (kix) [Tue, 22 Jan 2013 20:18:14 +0000 (22 21:18 +0100)]
New function set_icon_image_from_database
The new function set_icon_image_from_database() removes the dup code
from these functions:
icon.c:icon_create_for_dock()
icon.c:icon_create_for_wwindow()
appicon.c:removeAppIconFor()
The only different change is that in the functions icon_create_for_dock()
and icon_create_for_wwindow(), the icon->tile_type assignment is done
before set the icon image filename and icon image, but this variable
is not used in these functions (is used in wIconUpdate function) but in both
functions the icon->tile_type assignment is done before wIconUpdate(), like
the code previous to this patch, so there is no problem moving icon->tile_type.
Rodolfo García Peñas (kix) [Tue, 22 Jan 2013 20:18:13 +0000 (22 21:18 +0100)]
Update docked icon after kill dockapp
This patch sets the correct icon after kill a docked application.
To reproduce the problem (as Carlos reported to me), follow these
steps:
1. With a docked application, not running, set the icon image.
2. Launch the docked application.
3. Kill the application, using for example the app dock menu.
The icon is lost. But if wmaker is restarted, the icon backs again.
The problem is because when the application is closed, the function
removeAppIconFor() calls wIconUpdate(), but this function doesn't
find the icon in the file system again. The icon is loaded from the
filesystem only when the application is created.
This patch creates the icon image again, then calls wIconUpdate() to
set the icon image or the default icon image if the icon image was
not found, then wPaint it.
These lines comes from the create_appicon_from_* functions, used
to set the icon image for docks and applications. Are copy/pasted.
Carlos R. Mafra [Tue, 18 Dec 2012 19:10:15 +0000 (18 19:10 +0000)]
Window placement: Enforce center position
When the "Center" choice for window position is chosen, really enforce
the center position for all windows, instead of falling back to "Auto"
when there are already windows on the workspace.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
Rodolfo García Peñas (kix) [Tue, 8 Jan 2013 15:58:04 +0000 (8 16:58 +0100)]
WINGs: New function W_setconf_doubleClickDelay
The new function W_setconf_doubleClickDelay() sets the value for
WPreferences.W_setconf_doubleClickDelay(), therefore the private
data of WPreferences struct is not used.
This call is used at defaults.c to set the doubleClickDelay().
Rodolfo García Peñas (kix) [Tue, 8 Jan 2013 15:58:03 +0000 (8 16:58 +0100)]
Don't access to private WINGs info
From the BALATON Zoltan comment:
If the P in WINGsP.h stands for Private then no files outside of WINGs
should include it. If WINGsConfiguration is an internal structure of
WINGs then only accessor methods should be used outside of WINGs.
This patch uses the new functions to read the WINGs configuration, not
using the internal library data.
Rodolfo García Peñas (kix) [Tue, 8 Jan 2013 15:58:02 +0000 (8 16:58 +0100)]
WINGs: Functions to read the Mouse Wheel conf
These new functions:
unsigned W_getconf_mouseWheelUp(void);
unsigned W_getconf_mouseWheelDown(void);
returns the WINGs configuration for the Mouse Wheel Up and Down
values.
Rodolfo García Peñas (kix) [Tue, 8 Jan 2013 08:08:26 +0000 (8 09:08 +0100)]
New shutdown.h file
The new shutdown.h file includes the shutdown modes and the functions
to shutdown Window Maker.
The function definitios were moved from funcs.h and the struct WShutdownMode
from WindowMaker.h.
Now, externs are not needed, only include shutdown.h
Rodolfo García Peñas (kix) [Tue, 8 Jan 2013 08:08:24 +0000 (8 09:08 +0100)]
Removed XRANDR externs
This patch moves the XRANDR variable definitions to screen.h, because
xrandr is related to screen behavior. Then, the definition externs
can be removed.
This patch also changes (in event.c) the ConfigureNotify event processing
to avoid call the "if" block if XRANDR is not enabled. I chose the option of
move the if into the HAVE_XRANDR block instead of include the
ConfigureNotify case inside of the HAVE_XRANDR block (proposed by
BALATON Zoltan) to avoid call the default option if not needed.
SJS [Tue, 8 Jan 2013 20:44:15 +0000 (8 20:44 +0000)]
README capitalization fix
Typo fix in the README.
Andreas Bierfert [Mon, 7 Jan 2013 20:51:11 +0000 (7 21:51 +0100)]
Include LGPL with correct FSF address
(see http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt)
Andreas Bierfert [Mon, 7 Jan 2013 20:51:05 +0000 (7 21:51 +0100)]
Fix incorrect FSF address
Carlos R. Mafra [Sun, 6 Jan 2013 22:56:37 +0000 (6 22:56 +0000)]
Set mod+wheel to OFF by default
Resizing windows with the mouse wheel was introduced in
a0633381755
("Mod+Wheel Window Resize") and it should be disabled by default
in order to not confuse users.
Users wanting this behavior can enable it through WPrefs.
Bug report: https://bugs.launchpad.net/ubuntu/+source/wmaker/+bug/
1082879
Kamil Rytarowski [Sat, 5 Jan 2013 11:17:41 +0000 (5 12:17 +0100)]
Fix underlinking
libWMaker (wmlib) requires -lX11.
Carlos R. Mafra [Thu, 3 Jan 2013 23:29:16 +0000 (3 23:29 +0000)]
Window Maker 0.95.4
Kamil Rytarowski [Thu, 3 Jan 2013 22:07:00 +0000 (3 23:07 +0100)]
Fix build with automake-1.13 and modernize .am files.
The following macro: AM_CONFIG_HEADER is deprecated and replaced with AC_CONFIG_HEADERS. INCLUDES is an old version of AM_CPPLAGS.
Rodolfo García Peñas (kix) [Thu, 3 Jan 2013 19:41:01 +0000 (3 20:41 +0100)]
Debian changes for final 0.95.4
These are the final changes for the new version 0.95.4. The main change
is set right the symbols for the new version, that include:
- Changes in debian/libwutil2.symbols from the git version to 0.95.4
- Changes in debian/changelog about the comments for the new version
On the other hand, the new debug schema is using hashes, therefore
the /usr/lib/debug/wmaker folder not longer exists. The new folder
is /usr/lib/debug/.build-id. This folder is auto-created and then
we don't need create it in debian/wmaker-dbg.dirs. Therefore, the file
debian/wmaker-dbg.dirs is empty and can be removed.
Finally, a little comment about folder in debian/README.Debian.
Carlos R. Mafra [Sat, 22 Dec 2012 02:23:24 +0000 (22 02:23 +0000)]
WINGs: Enable cursor blinking in text fields
This code was commented out but enabling it leads to no issues AFAICS
and improves the usability of WINGs applications.
The motivation for this patch comes from the need of distinguishing
where the cursor is in the WINGs-based application which handles the
database of my comics collection.
This changes the behavior in all parts of wmaker where there is
a text field entry, e.g. in the settings panel of dockapps. There should
be no issues with a blinking cursor in such cases though...
Carlos R. Mafra [Tue, 18 Dec 2012 18:29:50 +0000 (18 18:29 +0000)]
Revert "Maximized windows appear misplaced"
This reverts commit
b657f15344f193d70747689f96cefddc8baa2181.
Carlos R. Mafra [Tue, 18 Dec 2012 18:29:11 +0000 (18 18:29 +0000)]
Revert "Prevent windows from drifting on restart."
This reverts commit
3cd382bccc46b957c9a699fe5fa827f32704dfcd.
Conflicts:
src/window.c
Carlos R. Mafra [Tue, 18 Dec 2012 18:20:52 +0000 (18 18:20 +0000)]
Revert "Fixed regression when placing windows."
This reverts commit
4e193c172b79a742b9b3e72403fc1e1d579f7aa5.
Conflicts:
src/window.c
Carlos R. Mafra [Tue, 18 Dec 2012 18:18:14 +0000 (18 18:18 +0000)]
Revert "Prevent border drifting."
This reverts commit
df601267e640ce7eb171f2ce5044915a3cc358b2.
Conflicts:
src/window.c
Rodolfo García Peñas (kix) [Wed, 28 Nov 2012 23:10:18 +0000 (29 00:10 +0100)]
Avoid icon change to default on winspector save
For a icon, the icon image is stored in icon->file_image. If we repaint
the image, we we don't need search the icon again. We can continue using
icon->file_image.
Indeed, if launch the "window inspector" window (winspector), using a
saved icon and "ignore client icon" set, then the database holds the
name of the icon to draw on the screen. If we remove the icon info in
the winspector (removing the file name or un-setting the "ignore client
icon" flag, then the database losts the icon name and then the function
wDefaultUpdateIcons() cannot find the icon to draw for the icon.
In winspector, with this patch, the previous image set by "ApplySettings"
and stored at icon->file_image is used.
Rodolfo García Peñas (kix) [Wed, 28 Nov 2012 22:56:19 +0000 (28 23:56 +0100)]
winspector: Save iconpath if icon will be used
This patch avoids to save the icon name in the configuration file
if the flag "Ignore client supplied icon" is not selected.
First, when winspector tries to show the icon to the user, it must not search
the default icon. It should use the specific icon or the icon provided
by the client.
When we click in "save Settings", the function saveSettings reads the icon
specified by the user in the text box. If the checkbox "Ignore client supplied
icon" is not selected, then saves the icon too.
Using this behaviour we never recover the initial position (no icon selected,
no ignore client supplied icon flag set). This patch recovers the initial
state of the icon options.
When the user unsets the ignore client the filename provided is not saved in
the configuration file. Now, the configuration is like the initial status.
If the user checks the flag and set the file to use as icon, the file is used.
Rodolfo García Peñas (kix) [Wed, 28 Nov 2012 21:50:51 +0000 (28 22:50 +0100)]
winspector: Don't use text input if NULL
This patch don't use the text input for the file if is empty.
The function should use the function to get the icon provided
by the client.
Rodolfo García Peñas (kix) [Sun, 25 Nov 2012 20:44:36 +0000 (25 21:44 +0100)]
winspector.c: Full clean patch
This patch sets a correct style on winspector.c. It removes some
empty lines, moves variable definitions to the function heads,
moves preprocessor definitions to the top of the file and removes
some extra curly brackets.
The function to create the winspector panel is so big, and is hard
to understand it. This patch split the function createInspectorForWindow
in some extra functions:
create_tab_window_attributes
create_tab_window_advanced
create_tab_icon_workspace
create_tab_app_specific
This functions don't do nothing extra, only the code is moved to them.
Rodolfo García Peñas (kix) [Thu, 22 Nov 2012 21:40:12 +0000 (22 22:40 +0100)]
Avoid crash on icon move without command
This patch avoid a crash when moving an icon without command.
To reproduce the problem:
1. Launch an application, for example xeyes, with appicon.
2. Move the appicon to the clip.
3. Close the application.
4. Edit the appicon in the clip, and empty the commands fields.
5. Move the appicon from the clip to the dock. -> Crash.
The crash happends because icon->icon->owner is NULL and then
wwin will be NULL. Then the call of wwin->client_win will crash.
This patch checks if icon->icon->owner is not null (application is
running) and then assign it to wwin. Then get the command from the
running application.
Martin Frydl [Tue, 27 Nov 2012 10:13:34 +0000 (27 11:13 +0100)]
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.
Amadeusz Sławiński [Fri, 23 Nov 2012 19:16:59 +0000 (23 20:16 +0100)]
Fix Maximize/Unmaximize in window menu
Add variable to track window startup size and use it when checking for changes
John H. Robinson, IV [Wed, 14 Nov 2012 20:15:44 +0000 (14 12:15 -0800)]
Makefile: Add forgotten .h files
Please find attached a diff to add the missing .h files from src/Makefile.am
One way to find these:
$ git checkout next
$ ./autogen.sh
$ ./configure
$ make dist-gzip
$ tar xzf WindowMaker-0.95.3.tar.gz
$ cd WindowMaker-0.95.3
$ ./configure
$ make
Rodolfo García Peñas (kix) [Sun, 18 Nov 2012 22:07:50 +0000 (18 23:07 +0100)]
stacking.h removed white lines
The white lines in stacking.h were removed.
Rodolfo García Peñas (kix) [Sun, 18 Nov 2012 22:07:47 +0000 (18 23:07 +0100)]
window.c clean code 1
This patch only make some code style clean.
Rodolfo García Peñas (kix) [Sun, 18 Nov 2012 22:07:46 +0000 (18 23:07 +0100)]
create_stdcmap is never used
The create_stdcmap variable is never set, so can be removed.
This patch don't update the translation .po files!
Christophe CURIS [Sat, 17 Nov 2012 23:45:26 +0000 (18 00:45 +0100)]
Moved parameters of WPrefs's expert check-buttons to a single place
The list of options in the Expert tab of WPrefs.app was filled using
hard-coded list of commands with static indexes and the related
usage were spread accross procedures. This was dangerous because
it could lead to mismatched indexes, the list length being also
variable, so it was hard to update.
This patch proposes to group all the options in a single place (a
static const array), so it is easy to add/remove/reorder the options,
and the code just parses this array based on its auto-calculated
size.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 23:59:34 +0000 (15 00:59 +0100)]
applySettings icon set updated
The function applySettings() set now the icons. Updated icons are:
- Appicon: Always, with or without always_user_icon
- Window: If the window is minimized, with or without always_user_icon.
Window must be minimized to see the icon change, else, wwin->icon
doesn't exist and therefore you won't see this change (no icon).
There is a problem if the window is not minimized and is minimezed,
because it will show the icon in the database, not the assigned icon.
This problem must be updated not here, in the wIconifyWindow()
function, at actions.c
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 23:44:00 +0000 (15 00:44 +0100)]
get_rimage_icon_from_wm_hints returns image
The function get_rimage_icon_from_wm_hints now returns an image.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 23:56:26 +0000 (15 00:56 +0100)]
wIconChangeImageFile set the file image
The function wIconChangeImageFile set the file_image variable directly,
now the code is faster and the assigned image is used.
Before this patch, the assigned file couldn't be used, because wIconUpdate
serached the icon using different methods.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 23:53:03 +0000 (15 00:53 +0100)]
wIconUpdate wwin checks
The variable wwin is only used in one block of the if, so should be moved
inside this block. OTOH, is better check if the variabl exists before
assign it. The code now is more stable and avoid crashes.
Rodolfo García Peñas (kix) [Sat, 17 Nov 2012 17:49:50 +0000 (17 18:49 +0100)]
update_icon_pixmap don't paint dock icon
The dock applications has their icon image set in icon->file_image
to draw the icon if the application is not running. But if the
application is running, the icon mustn't be show. This patch don't
paint the icon for docks.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 18:53:04 +0000 (14 19:53 +0100)]
wIconUpdate image preselected
The function wIconUpdate can receive a image to setup as icon image.
If image is NULL, then use the original method, using different procedures
to get the image.
BALATON Zoltan [Fri, 16 Nov 2012 21:07:47 +0000 (16 22:07 +0100)]
WPrefs: Fixed handling of options which default to true
Two problems caused Boolean options which default to true to be shown
incorrectly when the option was not already present in the defaults database.
First a typo (Enabled instead of Selected) caused the switch button to stay
off then because GetBoolForKey key returns False also when the option
is not set it would have been turned off while it should stay on to
reflect the default value of the option.
BALATON Zoltan [Fri, 16 Nov 2012 20:53:57 +0000 (16 21:53 +0100)]
Made highlighting the AppIcon of the active app configurable at run time
Iain Patterson [Sat, 17 Nov 2012 00:00:07 +0000 (16 16:00 -0800)]
Prevent border drifting.
Windows were drifting by FRAME_BORDER_WIDTH pixels when their
borders were toggled on or off.
Windows which had a border before we managed them were drifting
on shutdown and again at startup. It happened because the absolute
upper-left co-ordinates of a bordered window would in fact be the
upper-left co-ordinates of the border itself, whereas we consider
the client window to have no border and co-ordinates offset by the
titlebar and frame border.
Iain Patterson [Fri, 16 Nov 2012 22:43:52 +0000 (16 14:43 -0800)]
Fixed regression when placing windows.
The initial fix for the bug reported by Paul Seelig whereby windows
would drift on restart introduced two regressions.
New windows would place higher on the screen than intended, possibly
obscuring the bottoms of other windows with their titlebars, and all
windows would jump vertically at shutdown because we weren't restoring
them to where they were before they had a titlebar and border.
Iain Patterson [Fri, 16 Nov 2012 00:55:52 +0000 (15 16:55 -0800)]
Prevent windows from drifting on restart.
Bug report from Paul Seelig:
"Yet another rather strange glitch:
- open three terminal windows
- repeatedly restart wmaker
- all windows slowly drift to the left and up by just a few pixels
If i remember correctly, this is also a longstanding issue and nothing
new. It is no showstopper either, as one rarely restarts wmaker."
The slight drifting left and up seems to have been due to
wWindowConfigure() accounting for the window border when placing, which
was fixed in an earlier commit.
Windows could still shuffle down, however, because wWindowConfigure()
was moving the window down to make room for its window frame.
We now move it up by the titlebar height to cancel out that movement.
Christophe CURIS [Fri, 16 Nov 2012 00:24:07 +0000 (16 01:24 +0100)]
Added option to 'configure' to control debug information for compilation
As reported by Amadeusz Sławiński, there were a number of debug-only
information printed by the menu parser, which had no reason to be
in a user package.
This patch removes all the hard-coded DEBUG definitions pointed
by Amadeusz and adds a new (standard-like) option '--enable-debug'
to the configure script, which activates debug stuff for the devs.
The default behaviour is now to not have them.
As a side effect, the option also disable optimisation, which are
generally annoying when trying to run a debugger.
BALATON Zoltan [Thu, 15 Nov 2012 01:53:50 +0000 (15 02:53 +0100)]
WPrefs: More moving around of options and tweaks to layout
Managed to squeeze two more options from the expert page to the
corresponding pages and also reorganised some widgets to avoid large
now unused spaces in one place and clipped text in the other.
Christophe CURIS [Thu, 15 Nov 2012 00:30:33 +0000 (15 01:30 +0100)]
Fixed wrong count to release temporary memory
As found by Rodolfo, it looks like there could be memory leak in the
function 'RSmoothScaleImage' because it reserveda given number of
memory blocs but used another count to free them after use.
This patch uses the same count for release as it seems this variable
is not modified in between. Took the opportunity as Rodolfo proposed
to convert a global variable to a local variable - this global
definition seems incorrect.
Christophe CURIS [Wed, 14 Nov 2012 21:05:35 +0000 (14 22:05 +0100)]
Changed handling of quoted strings in the menu parser for consistency
As reported by Amadeusz Sławiński, the support for (d)quoted string
in the menu file was not exactly the same as in previous versions
of WindowMaker, so we had a regression which is not acceptable.
This patch propose a consistent handling for (d)quoted text instead
of the previous on-the-title-only code; now all (d)quoted strings
are still kept as-is (as expected) but the (d)quotes are always
removed.
As a side note, it also improve the support for \escaped character
to work correctly as mentioned in the example of the default menu.
Note: This reverts
b2e7620868aa18cebb8f6d1e653f8c46dc959a34 which
was an incomplete solution to the problem.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 21:11:49 +0000 (14 22:11 +0100)]
wIconUpdate removed scr variable
The variable scr is not used, so MUST be removed.
This variable can cause a segfault because icon could not exist.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 18:00:22 +0000 (14 19:00 +0100)]
get_default_image resize image
The function get_default_image, used to read the default image, now
resizes it to the desired size.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 18:26:12 +0000 (14 19:26 +0100)]
wIconValidateIconSize checks the width and height
The function wIconValidateIconSize checks if the width size and height size are
less than the preference size (and left space for the border). If the width
size or height size is greater than the preference, then checks what is the
bigger size of them. Then resize it using the bigger value and holding the
aspect ratio.
Before this patch, wIconValidateIconSize didn't check if height was bigger
than width and always suppose that width was greater than height.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 17:36:25 +0000 (14 18:36 +0100)]
get_wwindow_image_from_wmhints scale image
The function get_wwindow_image_from_wmhints returns a image from WM Hints,
but the image could be larger than the desired.
Then, the image can be resized using wIconValidateIconSize(). The resize
should be done in get_rimage_icon_from_wm_hints(), not in the function
get_wwindow_image_from_wmhints(). This is because the function
get_wwindow_image_from_wmhints() is used in wIconStore() too. If we resize
the image before save it to disk, then if we change the icon/dock size, then
the image saved will have a different size than the curren icon size. Is
better resize the image when is painted in the screen, not the image saved.
Rodolfo García Peñas (kix) [Wed, 14 Nov 2012 19:06:14 +0000 (14 20:06 +0100)]
Remove dup set icon file to NULL
Remove the icon->file = NULL because was set in unset_icon_image().
Christophe CURIS [Wed, 14 Nov 2012 20:23:32 +0000 (14 21:23 +0100)]
Added reset of pointer after memory free to avoid double-free crash
As reported by Rodolfo, there are some cases when working with icons
where a crash can occur, which is related to trying to re-release
some memory that have been already freed previously.
This patch adds a reset-to-NULL of the corresponding pointers so that
on next usage wmaker will know there's no more memory associated with
these pointers.
Carlos R. Mafra [Wed, 14 Nov 2012 10:20:27 +0000 (14 10:20 +0000)]
appicon: Avoid double 'Hide' entry
On 12.11.2012 Paul Seelig reported:
- open an application positioning an app icon on the bottom
- right click this app icon to show the context menu
- wonder yourself why there are two lines saying "Hide"
- first Hide entry does not do anything, second does
The reason for this curious behavior is the following.
The "Launch" entry was added in
8352c9ef60 ("Allow relaunch with shortcut key")
as the first one in the appicon menu, but this first position was hard-coded
in another part of wmaker's code in order to decide the menu entry text based
on the application's 'hidden' state in openApplicationMenu():
if (wapp->flags.hidden)
menu->entries[1]->text = _("Unhide");
else
menu->entries[1]->text = _("Hide");
But the "Launch" entry is before these "Hide/Unhide" entries and now the assumption
about entries[1] containing the relevant string for this hide/unhide decision is
no longer valid.
The simpler "fix" is to move the "Launch" entry below these "Hide/Unhide" games.
BALATON Zoltan [Wed, 14 Nov 2012 00:24:06 +0000 (14 01:24 +0100)]
WPrefs: Move around some options between pages
Move bounce options from expert prefs to its own box on ergonomic
prefs to have them at one place which makes them somewhat more clear.
The options previously occupying this place have been moved to other
pages where they better belong.
BALATON Zoltan [Tue, 13 Nov 2012 20:30:56 +0000 (13 21:30 +0100)]
WPrefs: Update translations
Carlos R. Mafra [Mon, 12 Nov 2012 22:50:23 +0000 (12 22:50 +0000)]
WPrefs: Remove pointless 'this is annoying' warning
Is it annoying to whom?
Carlos R. Mafra [Mon, 12 Nov 2012 22:44:03 +0000 (12 22:44 +0000)]
Remove last QUIET hack from Makefiles
They somehow were missed in
5c8eb580b34cc ("configure:
Remove --disable-verbose-compile hack")
BALATON Zoltan [Mon, 12 Nov 2012 20:44:25 +0000 (12 21:44 +0100)]
Fixed out of source dir build
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:54:43 +0000 (10 20:54 +0100)]
Window comments cleanup
This patch only add some tabs the window.h (only window struct area).
The main change is that moves this block to switchpanel.c, because
is only used there:
((w)->wm_gnustep_attr->flags & GSWindowLevelAttr) && \
((w)->wm_gnustep_attr->window_level == WMMainMenuWindowLevel || \
(w)->wm_gnustep_attr->window_level == WMSubmenuWindowLevel))
The patch also include two comments in the window's image:
- WIcon icon is only used when the window is minimized, else is NULL
- RImage has the window image, used in switchpanel,...
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:25:14 +0000 (10 20:25 +0100)]
wAppIconPaint argument removed
This patch removes the wAppIconPaint() Bool flag, because now it is
always False.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:25:13 +0000 (10 20:25 +0100)]
Update icon images before calling wIconUpdate
This patch updates the icon images if needed before calling wIconUpdate.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:25:12 +0000 (10 20:25 +0100)]
force_paint removed
The WIcon variable force_paint can be removed, because now is possible
update the icon directly in the function wAppIconPaint.
Now wAppIconPaint creates the RImage file if needed, and then paint it.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:25:11 +0000 (10 20:25 +0100)]
wAppIconPaint paint argument
The function wAppIconPaint has a new argument. This argument is used
to force an icon create if needed.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 19:25:10 +0000 (10 20:25 +0100)]
wDockAttachIcon paint argument
The function wDockAttachIcon has a new argument. This argument is used
to force an icon create if needed.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 18:25:56 +0000 (10 19:25 +0100)]
get_default_image_path unused argument
The function get_default_image_path has the WScreen argument that
is not used, so can be removed.
The function could be static, but perhaps is interesting leave it
as public.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 18:25:55 +0000 (10 19:25 +0100)]
wDefaultGetImage renamed to get_icon_image
The function wDefaultGetImage is renamed to get_icon_image.
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 18:25:54 +0000 (10 19:25 +0100)]
get_default_icon_filename rewritten
The function get_default_icon_filename(), now get_icon_filename(),
was working in a bad way. Before this patch, the function always
searched the default icon in the second search:
- file_name = wDefaultGetIconFile(winstance, wclass, True);
+ file_name = wDefaultGetIconFile(winstance, wclass, False);
For this reason, the argument default_icon didn't work.
This patch change it. Now, if the default_icon is false, the function
can return NULL, then other functions can do the correct work. For
example, now wDefaultGetImage() doesn't need do nothing, because the
default_icon is set to True. get_icon_filename() checks if the
icon exists in the disk before returning it (except for default icon
in get_default_image_path(scr).
Rodolfo García Peñas (kix) [Sat, 10 Nov 2012 18:25:53 +0000 (10 19:25 +0100)]
wDockAttachIcon icon_editing is common in if else
The line "icon_editing = 0" is the first line in the "if" sentence
and the first (and only) sentence in the "else" block, so can be
moved outside the if-else (and the empty else block can be removed).
Iain Patterson [Fri, 9 Nov 2012 22:39:57 +0000 (9 14:39 -0800)]
Maximized windows appear misplaced
Bug report from nikty:
"Window Maker does remember the size of windows, but for maximized windows it does not keep the position.
When a maximized window appears it is shifted to the right for a few pixels (firefox, thunar) or both to the right and to the bottom (openoffice, vlc, virtualbox)."
We weren't accounting for the window border when calculating whether the window would position correctly.
To reproduce:
* Launch some application which remembers its position. I used
Thunar as suggested in the bug report.
* Maximize!
* Kill the application.
* Launch it again.
* Maximize! The expected behaviour is that nothing would happen
because the window should have started right where it was before.
Observed behaviour is that it moves a few pixels.
After the patch we can verify that the maximize operation is
idempotent with regards to geometry.
Tested with and without Xinerama, with and without a panel strutting
one edge.
Bug report: http://www.kix.es/mantis/view.php?id=4
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:07 +0000 (3 19:54 +0100)]
appearanceObserver doesn't create icon again
The function appearanceObserver() is now faster because it doesn't
re-create the icon. Now it only draws the icon pixmap.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:06 +0000 (3 19:54 +0100)]
wIconSetHighlited: Do not create the icon again
The function wIconSetHighlited() is now faster because it doesn't
re-create the icon before setting the Highlited status. Now it only
draws the icon pixmap.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:05 +0000 (3 19:54 +0100)]
New function update_icon_pixmap
The new function update_icon_pixmap() updates the pixmap for a icon task.
Now, wIconCreate() creates the image and sets the icon->file and
icon->file_image variables and update_icon_pixmap() updates the icon->pixmap.
This is interesting because we can update the pixmaps without creating the
image again.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:04 +0000 (3 19:54 +0100)]
wIconUpdate create rimage and then pixmap
The function wIconUpdate now create the rimage for the icon, using
different functions. When the icon is created, then the pixmap is
generated using this rimage.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:03 +0000 (3 19:54 +0100)]
Split get_pixmap_icon_from_icon_win()
The function get_pixmap_icon_from_icon_win(), before this patch,
creates the pixmap icon for dockapps (docks with a mini application
inside). The function did three steps:
1. Create the (r)image
2. Create the pixmap using the image
3. Put the application inside the image
Now these three steps are three functions:
step 1: static void get_rimage_icon_from_icon_win(WIcon *icon);
step 2: static void get_pixmap_icon_from_icon_win(WIcon *icon);
step 3: static void set_dockapp_in_icon(WIcon *icon);
These functions contains the same code, that before the changes.
The original function get_pixmap_icon_from_icon_win() includes the
calls to the new functions get_rimage_icon_from_icon_win() and
set_dockapp_in_icon()
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:02 +0000 (3 19:54 +0100)]
Solved bug if icon doesn't exists
There is a bug in wmaker with icon files set in config files, but
that doesn't exist in the disk. For example, if the config files have:
etc/WindowMaker/WMWindowAttributes:
xcalc = {AlwaysUserIcon = Yes;Icon = "HP-16C-48.xpm";};
share/WindowMaker/IconSets/Default.iconset:
xcalc = {AlwaysUserIcon = Yes;Icon = "HP-16C-48.xpm";};
But the icon "HP-16C-48.xpm" doesn't exist in the disk, wmaker does:
1. Load the config file in memory, in a database
2. When the application is launched, wmaker tries to find their icon in
the database (using wDefaultGetIconFile), the icon is found: HP-16C-48.xpm
3. When WindowMaker try to find the full path for the icon, using FindImage(),
WindowMaker cannot find the icon, and returns NULL.
Even, if the user set the default_icon boolean variable to True, wmaker
finds in the database the wrong icon.
This patch checks that the icon exists both in the database AND in the disk. If the
icon doesn't exist in the disk and the default_icon variable is set to True,
then windowmaker loads the default icon using the function get_default_image()
because this function searches the default icon directly.
The function get_default_image() is moved from icon.c to wdefaults.c because
it is now used in both places. This function is now splitted, to find the file
(get_default_image_path) path and the file image (get_default_image)
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:01 +0000 (3 19:54 +0100)]
get_pixmap_icon_from_icon_win rewritten
The function get_pixmap_icon_from_icon_win() is now rewritten.
This function now creates the icon using the function get_window_image_from_x11(),
using itself as Window and updates the icon using icon_update_pixmap().
At this point the Pixmap is only the icon background. Now we must put inside the
dockapp, in the correct position. Then the funcion get the dock application size,
(the max size is wPreferences.icon_size, because get_window_image_from_x11() checks
the valid size), checks if the icon has title and then reparents the dockapp to put
it inside the icon.
This patch includes a lot of comments to better understand the code.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:54:00 +0000 (3 19:54 +0100)]
Make get_wwindow_image_from_x11() take Window as argument
The function get_wwindow_image_from_x11() is renamed to get_window_image_from_x11()
and does the same work, but now its argument is a Window struct instead of a
WWindow.
This change is better because it allows objects with Windows (but without
WWindows) to call this function.
The function now is not static to allow its use in other parts of the code.
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:53:59 +0000 (3 19:53 +0100)]
New functions get_*_icon_from_x11
A new functions get_pixmap_icon_from_x11 and get_rimage_icon_from_x11
are included in icon.h
1. get_pixmap_icon_from_x11, set the rimage at icon->file_image
The code sets net_icon_image in icon->file_image
2. The get_rimage_icon_from_x11 function, only converts
the icon->file_image in icon->pixmap
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:53:58 +0000 (3 19:53 +0100)]
Split get_pixmap_icon_from_wm_hints() into two
The function get_pixmap_icon_from_wm_hints() is splitted in two
functions now:
1. get_rimage_icon_from_wm_hints, set the rimage at icon->image
The code comes from the function get_pixmap_icon_from_default_icon()
2. The get_pixmap_icon_from_wm_hints() function, but now only converts
the icon->file_image in icon->pixmap
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:53:57 +0000 (3 19:53 +0100)]
Split get_pixmap_icon_from_user_icon() into two
The function get_pixmap_icon_from_user_icon() is splitted in two
functions now:
1. get_rimage_icon_from_user_icon, set the rimage at icon->image
The code comes from the function get_pixmap_icon_from_default_icon()
2. The get_pixmap_icon_from_user_icon() function, but now only converts
the icon->file_image in icon->pixmap
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:53:56 +0000 (3 19:53 +0100)]
Split get_pixmap_icon_from_default_icon() into two
The function get_pixmap_icon_from_default_icon() is splitted in two
functions now:
1. get_rimage_icon_from_default_icon, set the rimage at icon->image
The code comes from the function get_pixmap_icon_from_default_icon()
2. The get_pixmap_icon_from_default_icon(), but now only converts
the icon->file_image in icon->pixmap
Rodolfo García Peñas (kix) [Sat, 3 Nov 2012 18:53:54 +0000 (3 19:53 +0100)]
New helper function unset_icon_image()
The new function unset_icon_image() removes the RImage and the
file path for a given icon.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:24 +0000 (31 22:44 +0100)]
get_pixmap_icon_from_wm_hints rewritten
The function get_pixmap_icon_from_wm_hints() is now rewritten using
the functions get_wwindow_image_from_wmhints() and icon_update_pixmap().
Now, the function creates a new RImage using get_wwindow_image_from_wmhints()
and then updates the Pixmap using the function icon_update_pixmap().
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:23 +0000 (31 22:44 +0100)]
get_pixmap_icon_from_wm_hints uses getSize
The function get_pixmap_icon_from_wm_hints() now uses getSize() and
the code dup is removed.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:22 +0000 (31 22:44 +0100)]
getSize returns XGetGeometry exit
The function getSize now returns the returned value by XGetGeometry.
The function now is not INLINE.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:21 +0000 (31 22:44 +0100)]
CachedPixmaps added as pixmap folder
The CachedPixmap folder is added to the icon list. This is because
if one icon is created, but the user change it and set other icon, the first
icon cannot be selected anymore using the settings window. The user
needs modify the configuration files by hand.
Some extra paths are added to the debian default config file.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:19 +0000 (31 22:44 +0100)]
wIconChangeImageFile change image only if found
This patch changes the behavior of wIconChangeImageFile.
Before apply this patch the behavior was:
The image (file_image) is set to NULL, then the function tried to find
a new image. If the new image was not found, the variable file_image contains
NULL when the function returns, and the return code was 1.
With this patch the image is changed only if a new image is found.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:18 +0000 (31 22:44 +0100)]
wIconChangeImageFile removed dup code
This patch removes the dup code with get_rimage_from_file.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:17 +0000 (31 22:44 +0100)]
wIconChangeImageFile don't update without file
The function wIconChangeImageFile mustn't update the icon if
no file is set.
This is a bug. To reproduce it:
1. Right click on dock icon. Select "Settings"
2. Erase the Icon Image contents (set empty)
3. Click "OK" -> Exit, no changes... no?
4. Right click on the same dock icon. Select "Settings"
5. Erase the Icon Image contents (set empty)
6. Click "OK" -> Crash
If wmaker don't crash, watch the file ~/GNUstep/Defaults/WMWindowAttributes,
the default icon ("*" has trash in the name). Probably something is not fine
at wIconUpdate.
Rodolfo García Peñas (kix) [Wed, 31 Oct 2012 21:44:16 +0000 (31 22:44 +0100)]
Removed dup code at get_default_image
This patch removes the code dup at get_default_image. Now,
this function calls get_rimage_from_file()
Iain Patterson [Mon, 29 Oct 2012 22:49:43 +0000 (29 15:49 -0700)]
Allow struts from all windows.
Respect _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL from all windows, not
just WWindows. This will allow us to respect struts from app icons
and dock icons.