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

2925 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
c164db31bf 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.
2012-11-29 09:35:51 +00:00
Rodolfo García Peñas (kix)
e206f471fe 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.
2012-11-29 09:30:25 +00:00
Rodolfo García Peñas (kix)
99e5a7a9eb 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.
2012-11-29 09:27:30 +00:00
Rodolfo García Peñas (kix)
bf2f942138 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.
2012-11-28 00:12:59 +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
Amadeusz Sławiński
eae7ef6c59 Fix Maximize/Unmaximize in window menu
Add variable to track window startup size and use it when checking for changes
2012-11-24 11:07:32 +01:00
John H. Robinson, IV
ea7ef65b19 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
2012-11-19 23:57:46 +01:00
Rodolfo García Peñas (kix)
e393c6b61a stacking.h removed white lines
The white lines in stacking.h were removed.
2012-11-19 00:12:46 +01:00
Rodolfo García Peñas (kix)
db6605932b window.c clean code 1
This patch only make some code style clean.
2012-11-18 23:40:13 +01:00
Rodolfo García Peñas (kix)
4111f336d0 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!
2012-11-18 23:40:12 +01:00
Christophe CURIS
8b6e96ab74 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.
2012-11-18 17:23:20 +01:00
Rodolfo García Peñas (kix)
2165faec5d 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
2012-11-17 21:10:36 +01:00
Rodolfo García Peñas (kix)
3f2c87fb06 get_rimage_icon_from_wm_hints returns image
The function get_rimage_icon_from_wm_hints now returns an image.
2012-11-17 21:10:24 +01:00
Rodolfo García Peñas (kix)
5bfac9036d 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.
2012-11-17 20:38:50 +01:00
Rodolfo García Peñas (kix)
0a06ddd9e3 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.
2012-11-17 20:38:45 +01:00
Rodolfo García Peñas (kix)
4b4c5513ce 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.
2012-11-17 20:38:40 +01:00
Rodolfo García Peñas (kix)
522d84b0ef 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.
2012-11-17 20:38:36 +01:00
BALATON Zoltan
faa74a14b1 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.
2012-11-17 20:32:11 +01:00
BALATON Zoltan
c7e3666e62 Made highlighting the AppIcon of the active app configurable at run time 2012-11-17 20:32:10 +01:00
Iain Patterson
df601267e6 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.
2012-11-17 11:49:44 +01:00
Iain Patterson
4e193c172b 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.
2012-11-17 11:49:28 +01:00
Iain Patterson
3cd382bccc 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.
2012-11-16 08:06:29 +00:00
Christophe CURIS
27d55b3e33 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.
2012-11-16 08:06:19 +00:00
BALATON Zoltan
2a025b2edd 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.
2012-11-15 12:41:44 +00:00
Christophe CURIS
806784e194 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.
2012-11-15 12:38:25 +00:00
Christophe CURIS
5a3cab3cef 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 b2e7620868 which
was an incomplete solution to the problem.
2012-11-15 12:37:16 +00:00
Rodolfo García Peñas (kix)
2eb1107e20 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.
2012-11-14 22:55:45 +00:00
Rodolfo García Peñas (kix)
d8b92c979e get_default_image resize image
The function get_default_image, used to read the default image, now
resizes it to the desired size.
2012-11-14 22:49:42 +00:00
Rodolfo García Peñas (kix)
78ff715d39 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.
2012-11-14 22:48:08 +00:00
Rodolfo García Peñas (kix)
5956d71d77 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.
2012-11-14 22:47:26 +00:00
Rodolfo García Peñas (kix)
ead0fb2e4b Remove dup set icon file to NULL
Remove the icon->file = NULL because was set in unset_icon_image().
2012-11-14 22:40:00 +00:00
Christophe CURIS
7746fe7c5a 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.
2012-11-14 22:39:37 +00:00
Carlos R. Mafra
5dcd31acbe 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.
2012-11-14 10:20:32 +00:00
BALATON Zoltan
92d52523c4 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.
2012-11-14 01:11:43 +00:00
BALATON Zoltan
eb51844fa8 WPrefs: Update translations 2012-11-13 21:16:57 +00:00
Carlos R. Mafra
2dc97e4f15 WPrefs: Remove pointless 'this is annoying' warning
Is it annoying to whom?
2012-11-12 22:50:49 +00:00
Carlos R. Mafra
141b046c33 Remove last QUIET hack from Makefiles
They somehow were missed in 5c8eb580b3 ("configure:
Remove --disable-verbose-compile hack")
2012-11-12 22:44:33 +00:00
BALATON Zoltan
49922831e8 Fixed out of source dir build 2012-11-12 22:05:44 +00:00
Rodolfo García Peñas (kix)
f846b7cdd3 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,...
2012-11-11 12:00:59 +00:00
Rodolfo García Peñas (kix)
cc1503a2f0 wAppIconPaint argument removed
This patch removes the wAppIconPaint() Bool flag, because now it is
always False.
2012-11-11 11:59:41 +00:00
Rodolfo García Peñas (kix)
a950d0e247 Update icon images before calling wIconUpdate
This patch updates the icon images if needed before calling wIconUpdate.
2012-11-11 11:59:19 +00:00
Rodolfo García Peñas (kix)
e192302bd7 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.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
33ebded4f9 wAppIconPaint paint argument
The function wAppIconPaint has a new argument. This argument is used
to force an icon create if needed.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
a3078a5095 wDockAttachIcon paint argument
The function wDockAttachIcon has a new argument. This argument is used
to force an icon create if needed.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
f38e5e40c8 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.
2012-11-10 19:49:13 +00: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)
c3a1c76b44 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).
2012-11-10 19:42:24 +00:00
Rodolfo García Peñas (kix)
6bc48464e9 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).
2012-11-10 19:41:34 +00:00
Iain Patterson
b657f15344 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
2012-11-09 23:35:16 +00:00
Rodolfo García Peñas (kix)
fd9bb936aa 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.
2012-11-04 12:54:16 +00:00