1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-25 16:02:33 +01:00
Commit Graph

151 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
7a2eb68aa4 Remove cache icon when detached
This pach removes the icon from the icon cache when the icon is
detached from the dock/clip.

That helps to hold tidy the icon cache folder.

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix)
8a822004ee save the icon filename instead the full path
This patch saves the icon filename in the database and in the disk. wmaker
can find the icon in the different folders, including the cache folder.

This patch is based in the comments of Zoltan:

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix)
b281587397 create_appicon_from_dock checks if no_appicon flag is set
As Josip Deanovic reported:

-------8<-------
In previous versions e.g. 0.80.2 up until 0.95.3 when an application
attributes are set with "NoAppIcon = Yes;" ("No application icon" option
in attributes window), it was possible to launch multiple instances of
the application from wmdock using double-click.

After doing a git bisect per your suggestion I have found and reported
this:

bc0700e016 is the first bad commit
commit bc0700e016
Author: Rodolfo García Peñas (kix) <kix@kix.es>
Date:   Mon Jun 18 11:15:19 2012 +0200

    Create WAppIcon always

    When the application is created, the WAppIcon now is created always,
    but it is only painted if the flag is not set.

    The icon initialization to NULL can be done now at
app_icon_create_from_docks
    because it is always called.

:040000 040000 7c58877ad5
33d52affb3 M      src
-------8<-------

This patch reverts this change (not the patch). Now the function
create_appicon_from_dock checks if the flag no_appicon is set,
and then, do not execute the code related to the appicon.

Because the connection between the icon and the window is broken
(icon->owner is null) we need check if the icon->owner exists
when we try to re-create the icon in the Window Attributes window.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Christophe CURIS
67b4302ef8 Renamed "apercu" to "minipreview" in the source code
To be consistent, all place where the not-properly-written "apercu" was
used in the source code (of wmaker and WPrefs) it has been replaced by an
appropriate "minipreview" or similar, to be in line with the new name
suggested by Yuri Tarasievich.

This new name is better understood by contributors who speak usual english,
but not this word which comes From french but is sparsely understood by
british people.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-31 11:10:30 +00:00
Christophe CURIS
38d160cb8c wmaker: minor fixes for the size of an aperçu
There was a probable bug when reading settings, because the function used
was 'getInt' which would try to store the result in a 'char'. As it would
be probably easier for user to have the value directly in pixels, the
storage is now done in an int so there won't be problem anymore.

Changed the behaviour of the constant APERCU_BORDER, which would be assumed
to be the size of the border in pixel, but in previous code it was actually
the sum of the two border (1 on each side). All maths have been changed to
have it as a single border width.

Took opportunity to group variable assignation for titleHeight and
shortenTitle in a single place, because it is not convenient to have them
spread around (one value in the beginning and others later in the code) and
using default values prevents some checks that modern compiler can do to
help produce safer code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Carlos R. Mafra
5da2fcb7e3 apercu: Make preview size a configuration option
Since the resolution of the Retina display tends to make everything small,
the default apercu preview size (twice the icon size) couldn't be used to
distinguish the window contents without tiring too much my eyes.

Therefore, let's make the apercu size a configurable option. You can set
it through the ApercuSize variable with

$ wdwrite WindowMaker ApercuSize 4

in multiples of the icon size (in this case the apercu size will be four
times the icon size).

The default size remains 2 (twice the icon size).
2014-08-20 18:11:37 +01:00
David Maciejak
c6c7652e24 wmaker: add miniwindow apercu
This patch is adding miniwindow apercu when the mouse
is over the miniwindows.

To enable it you have to run WPref, in Miscellaneous Ergonomic
Preferences, check miniwindow apercus.
Then, you will be able to see a screenshot of the app when the mouse
is over the miniwindow.
2014-08-20 11:52:01 +01:00
David Maciejak
58faae8ff5 wmaker: switch back icon name to the window name when needed
This patch is setting the icon name to the window name when
_NET_WM_ICON_NAME is not provided by the app.
2014-08-20 11:51:47 +01:00
Carlos R. Mafra
05ff62caaf Coding style: Change 'foo * bar' to 'foo *bar' in function arguments
Since 'foo' and 'bar' are not being multiplied...

Done automatically with the sed script:

/^[a-zA-Z][a-zA-Z]*.*(/{
s/ \* \([a-zA-Z]\)/ *\1/g
}

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-05-18 23:00:16 +01:00
Christophe CURIS
fd10d4069f wmaker: Marked args as unused for compiler in WINGs Notif callback code
The mechanism of Notifications in the WINGs toolkit is relying on
callbacks to dispatch notifications, which means having a fixed argument
list for the handling function.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:00:19 +01:00
Christophe CURIS
c34a55ed5a wmaker: Marked args as unused for compiler in XExposeEvent callback code
The custom drawing code for windows is handled using callback functions,
which means having a fixed argument list for that function.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:00:19 +01:00
Rodolfo García Peñas (kix)
6366aeef3a wIconChangeImageFile removed error variable
This patch removes the error variable, because is not changed
after their initialization.

This patch also removes the if check to wfree the path variable,
because this variable never is NULL.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
cc01ca5c6b wIconChangeImageFile get image block swapped
This patch swaps the if and the else blocks for the
image value. Now, if the image doesn't exist, and because
error is always "0" (is not changed after the definition),
we can exist from the wIconChangeImageFile function.

Before this patch, if the image was NULL, the error variable
was set to "1", so we must return !error, then return "0".

Because the "path" variable is not NULL, we must wfree it.

Now, the "Set the new image" block is moved out the if block.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
3250144b94 wIconChangeImageFile find image if block swapped
This patch swaps the "if (path)" block to "if (!path)"
therefore, the true block is now "error = 1" and the
false block is the call to get_rimage_from_file function.

The second change is that the "error = 1" statement is
changed to "return 0", because if "error" is "1", then
only the "return !error" statement is used, then we can
change it for "return !1" that is "return 0".

Then, we can move the get_rimage_from_file call out of the
if block.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Rodolfo García Peñas (kix)
d6fe27af15 wIconChangeImageFile returns int
The function wIconChangeImageFile now returns an integer value
instead of boolean.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-01 08:40:05 +02:00
Christophe CURIS
b48b3370e2 wmaker: Moved global var with list of cursors to the preferences variable
As the cursor choice for each action is actually a user choice,
it is logical to put this into the structure, instead of a poorly
defined 'extern' in every file.
2013-09-30 00:53:10 +02:00
Rodolfo García Peñas (kix)
278bf5ee7e get_icon_filename doesn't use WScreen
The function get_icon_filename now doesn't need the
argument WScreen, so can be removed.
2013-09-05 22:44:36 +01: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
Christophe CURIS
c9b816de75 wmaker: Added 'const' attribute to remaining functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Rodolfo García Peñas (kix)
9ededf6cb2 New header file winmenu.h
The file winmenu.h includes the function prototypes for winmenu.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
157209a035 New header file event.h
The file event.h includes the function prototypes for event.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
68cdba0e29 New header file startup.h
The file startup.h includes the function prototypes for startup.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Christophe CURIS
a18fd7cd69 Fixed const correctness in functions using 'wusergnusteppath'
The change introduced in previous commit for const correctness has
a small impact on WindowMaker's code, this patch fixes all the new
warnings.
2013-05-04 16:25:44 +01:00
Rodolfo García Peñas (kix)
29a5267485 icon_update_pixmap default moved to bottom
The default case is moved to the bottom of the switch case.

The default case should be removed, because the icon has always
a right value, because the icon creation always uses a real value:

kix@debian:~/src/wmaker/wmaker-crm/src$ grep wAppIconCreateForDock *c
appicon.c:WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
dock.c:         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMClip", TILE_CLIP);
dock.c:         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMDock", TILE_NORMAL);
dock.c:         btn = wAppIconCreateForDock(scr, NULL, name, "WMDrawer", TILE_DRAWER);
dock.c: aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL);
(1)dock.c:                         aicon = wAppIconCreateForDock(dock->screen_ptr, NULL,
kix@debian:~/src/wmaker/wmaker-crm/src$
kix@debian:~/src/wmaker/wmaker-crm/src$ grep TILE_ *c | grep -v ICON_TILE_SIZE
***[2]appicon.c:              tile = TILE_CLIP;
dock.c:         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMClip", TILE_CLIP);
dock.c:         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMDock", TILE_NORMAL);
dock.c:         btn = wAppIconCreateForDock(scr, NULL, name, "WMDrawer", TILE_DRAWER);
dock.c: aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL);
(2)dock.c:                                                       wm_instance, wm_class, TILE_NORMAL);
***[3]icon.c: icon->tile_type = TILE_NORMAL;
icon.c: case TILE_NORMAL:
icon.c: case TILE_CLIP:
icon.c: case TILE_DRAWER:
kix@debian:~/src/wmaker/wmaker-crm/src$ grep tile_type *c
icon.c: icon->tile_type = TILE_NORMAL;
***[1]icon.c: icon->tile_type = tile;
icon.c: switch (icon->tile_type) {
icon.c:         wwarning("Unknown tile type: %d.\n", icon->tile_type);
kix@debian:~/src/wmaker/wmaker-crm/src$

There are only three cases without value (asterisk in the line start) set
as preprocessor variable. (1) and (2) is the same call. These are the three cases:

Case [1]:

-------------8<--------------
WIcon *icon_create_for_dock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
{
        WIcon *icon;

        icon = icon_create_core(scr, 0, 0);
        icon->tile_type = tile;
-------------8<--------------

Calls to icon_create_for_dock, is only call in appicon.c:

-------------8<--------------
kix@debian:~/src/wmaker/wmaker-crm/src$ grep icon_create_for_dock *c
appicon.c:      aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile);
icon.c:WIcon *icon_create_for_dock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
kix@debian:~/src/wmaker/wmaker-crm/src$
-------------8<--------------

The call:

-------------8<--------------
WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
{
[snip]
        if (strcmp(wm_class, "WMDock") == 0 && wPreferences.flags.clip_merged_in_dock)
                tile = TILE_CLIP;
        aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile);
-------------8<--------------

And the calls to wAppIconCreateForDock() are checked before.

The case [2] is just the line:

-------------8<--------------
WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
{
[snip]
        if (strcmp(wm_class, "WMDock") == 0 && wPreferences.flags.clip_merged_in_dock)
***             tile = TILE_CLIP;
        aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile);
-------------8<--------------

Then, is sure too.

The case [3] is:

-------------8<--------------
WIcon *icon_create_for_wwindow(WWindow *wwin)
{
[snip]
        icon->tile_type = TILE_NORMAL;
-------------8<--------------

All windows have TILE_NORMAL.

Then, all cases are secure.
2013-04-17 10:23:10 +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
Carlos R. Mafra
529ee0bd21 Merge branch 'wmdrawer' into next 2013-04-12 02:14:41 +01:00
Daniel Déchelotte
e14e6b3da8 Add drawers to wmaker!
Drawers are horizontal docks, and they can themselves only live in the dock

To use them, right click on the dock or a docked appicon and select "Add
a drawer". Then move appicons into the drawer (drag them with the
mouse). You may change the icon of the drawer. By default, drawers
auto-expand and -collapse, and auto-raise/lower. This can be customized
in the same way as for the clip.

Set DisableDrawers to YES in G/D/WindowMaker if you do not want to see
the menu entry to add a drawer.

Just discovered this bug: the auto-attract icon functionality will not
work (to be precise, it crashes WM!) if the clip is disabled
(NoClip=YES). Will fix shortly, of course.
2013-04-12 02:14:10 +01:00
Rodolfo García Peñas (kix)
6aa43d356c wIconChangeTitle rewritten
The function wIconChangeTitle() now changes the icon title name
doing the full work (except painting it).

The function receives now the icon to change the name and the
wwindow with the new name. The function checks if icon and the
window exists.

Then, try to get the name using wNETWMGetIconName(), if not found
then try to read it from wGetIconName(). Then the icon has the new
name and the function returns.

This is better because:

1. We don't need a flag to know if the window got the name
   using the wNETWMGetIconName function. Now call this function
   always.

2. We do the same work in all calls to the wIconChangeTitle()
   function.

The functions that uses wIconChangeTitle (at client.c, icon.c and
wmspec.c) uses always the value set by wNETWMGetIconName() first,
else, the value set by wGetIconName(). This is the reason for the
flag net_has_icon_title. Now the flag can be removed.
2013-04-09 08:30:54 +01:00
Rodolfo García Peñas (kix)
fa27215fcc wIconPaint: avoid crashing if icon is NULL
This patch checks that the icon exists before painting it.
2013-04-09 08:30:45 +01:00
Rodolfo García Peñas (kix)
8cb744739c Remove wIconUpdate in tileObserver
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed.

Now, the icon pixmap is updated faster.

This change is more difficult to see, this is the explanation:

1. wIconUpdate() updates the icon for the applications, then call
   update_icon_pixmap() to re-create the pixmap.
2. tileObserver() is used if the event WNIconTileSettingsChanged() is
   launched. This event is used in the Notification for docks and wwindows:

WMAddNotificationObserver(tileObserver, icon, WNIconTileSettingsChanged, icon);

3. The function WNIconTileSettingsChanged() is used if the icon need refresh,
   used in the wReadDefaults() function. See code below. This function is used
   in the wmaker startup.

   if (needs_refresh & REFRESH_ICON_TILE)
     WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);

4. Finally, the flag to refresh the icon tile is throw by setIconTile():

   return (reset ? REFRESH_ICON_TILE : 0);

   And this function only changes the the icon tile if reset is "1", that
   happend if src->icon_tile:

        if (scr->icon_tile) {
          reset = 1;
          RReleaseImage(scr->icon_tile);
          XFreePixmap(dpy, scr->icon_tile_pixmap);
        }

5. Then, we can drop the function wIconUpdate(), because the change is in the
   icon_tile variable, used only in icon_update_pixmap(). This function is
   only used in update_icon_pixmap() (not in wIconUpdate):

kix@kentin:~/src/wmaker/git/wmaker-crm/src$ grep icon_tile icon.c
                tile = RCloneImage(scr->icon_tile);
        XSetWindowBackgroundPixmap(dpy, icon->core->window, scr->icon_tile_pixmap);
kix@kentin:~/src/wmaker/git/wmaker-crm/src$

static void icon_update_pixmap(WIcon *icon, RImage *image)
{
[snip]
  if (icon->tile_type == TILE_NORMAL) {
    tile = RCloneImage(scr->icon_tile);
  } else {
    assert(scr->clip_tile);
    tile = RCloneImage(scr->clip_tile);
  }
[snip]

The XSetWindowBackgroundPixmap() call doesn't matter here.
2013-04-08 22:06:27 +01:00
Rodolfo García Peñas (kix)
544bc8e7a7 Move out wIconUpdate from set_icon_image_from_database
The function set_icon_image_from_database() set the icon from the
database, but wIconUpdate() update the icon using different methods
, like for example get the image from X11. So, is better move the
wIconUpdate() to the function who call set_icon_image_from_database(),
to avoid understanding problems.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
883ed8ac9a wIconChangeTitle rewrited
The function wIconChangeTitle() function calls wIconUpdate() or
wIconPaint() depending of changed. In both cases the icon->file_image
doesn't change, only the icon title, so we can use the same image
and we don't need update it. Because the variable changed is removed,
we can use wIconPaint() here.

Then the variable changed is not used, and these lines can be removed.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
ca86f5594d New function update_icon_title
The function update_icon_title() updates the icon title.

The code comes from the function wIconPaint().
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
2c0a449f00 drawIconTitle renamed
The function drawIconTitle() only draw the icon title square, without
the title. The title must be set later, because yet is not initialized,
so is NULL.

Then, the right function name should be drawIconTitleBackground.

This patch also removes the variable titled.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
b3ca57674d Dockapps don't have title
The dockapps don't have title, so this code must be removed.
The title height is 0 then and the variable title_height can
be removed.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
4093d24625 wIconUpdate removed image argument
The argument image is not used in any call, so can be removed.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
c24499f6ad wIconChangeImageFile use set_icon_image_from_image
The function wIconChangeImageFile() now use set_icon_image_from_image()
then:

1. Don't need call unset_icon_image() because the memory is free in the
   function set_icon_image_from_image().
2. After update the icon info, it must set the file name.
3. The pixmap image could be updated.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
c088aba057 New function set_icon_image_from_image
The new function set_icon_image_from_image() sets the icon image using
a image provided as argument.

This function will be used to avoid call wIconUpdate() with the image
argument, doing the code easier and faster.

This patch calls unset_icon_image(), to free the icon image, to avoid
lost memory. After this patch, in winspector.c, the wIconUpdate() call
don't free the memory before update it.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
25d083a85f Removed extra XClearWindow call
The function XClearWindow() is called twice, we can remove one.
See the asterisks (**):

Before the call to wIconPaint():
-----------------8<--------------------------
+++ b/src/icon.c
@@ -621,7 +621,6 @@ void update_icon_pixmap(WIcon *icon)
                XSetWindowBackgroundPixmap(dpy, icon->core->window, icon->pixmap);

        /* Paint it */
**      XClearWindow(dpy, icon->core->window);
        wIconPaint(icon);
 }
-----------------8<--------------------------

First call in wIconPaint() function:
-----------------8<--------------------------
void wIconPaint(WIcon *icon)
{
        WScreen *scr = icon->core->screen_ptr;
        int x, l, w;
        char *tmp;

**      XClearWindow(dpy, icon->core->window);
-----------------8<--------------------------
2013-03-21 10:01:04 +00:00
Rodolfo García Peñas (kix)
bb48c35522 Window attributes moved to wCoreCreateTopLevel
The function wCoreCreateTopLevel() is used in two files (icon.c and
framewin.c), but after create the window, some attributes are changed.

This patch moves the change inside the wCoreCreateTopLevel(), avoiding to
call XChangeWindowAttributes() after the window creation. Now the window
is created in only one step, with all the final attributes.

Some details:

- The function wCoreCreateTopLevel() has now one argument more, the
  border pixel color. This attribute was used always as the screen
  frame_border_pixel, but in icon.c the attribute is changed to
  white_pixel. Now the function wCoreCreateTopLevel() receives the
  value frame_border_pixel in framewin.c and scr->white_pixel in
  icon.c, as argument.

- The vmask and attribs variables and the call to XChangeWindowAttributes()
  are removed in framewin.c and icon.c. The values CWSaveUnder for vmask and
  attribs.save_under = True are used if wPreferences.use_saveunders is True.

- CWBorderPixel is not needed in icon.c, because was previously set in wcore.c!
2013-03-21 10:01:04 +00:00
Rodolfo García Peñas (kix)
97d7c32184 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.
2013-01-22 21:46:39 +00: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
c7e3666e62 Made highlighting the AppIcon of the active app configurable at run time 2012-11-17 20:32:10 +01: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)
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