From: "Rodolfo García Peñas (kix)" <k...@kix.es>

The flag "supports_tiff" doesn't belong to the wScreen, because all
screens has (or not) the same value. If wmaker supports (or not) tiff
files is global to all wmaker, not to the screens.
---
 src/WindowMaker.h |    1 +
 src/appicon.c     |    2 +-
 src/screen.c      |   18 ------------------
 src/screen.h      |    1 -
 src/startup.c     |   14 +++++++++++++-
 5 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 21e6ff1..6c29c9c 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -366,6 +366,7 @@ extern struct WPreferences {
     unsigned int modifier_mask;               /* mask to use as kbd modifier */
     char *modifier_labels[7];          /* Names of the modifiers */
 
+       unsigned int supports_tiff;     /* Use tiff files */
 
     char ws_advance;                   /* Create new workspace and advance */
     char ws_cycle;                     /* Cycle existing workspaces */
diff --git a/src/appicon.c b/src/appicon.c
index e7ccb34..7b7323f 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -87,7 +87,7 @@ void wApplicationExtractDirPackIcon(WScreen * scr, const char 
*path, const char
        if (strstr(path, ".app")) {
                tmp = wmalloc(strlen(path) + 16);
 
-               if (scr->flags.supports_tiff) {
+               if (wPreferences.supports_tiff) {
                        strcpy(tmp, path);
                        strcat(tmp, ".tiff");
                        if (access(tmp, R_OK) == 0)
diff --git a/src/screen.c b/src/screen.c
index a5cb5fb..32e45fa 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -601,24 +601,6 @@ WScreen *wScreenInit(int screen_number)
                scr->rcontext = RCreateContext(dpy, screen_number, &rattr);
        }
 
-       if (!scr->rcontext) {
-               wwarning(_("could not initialize graphics library context: 
%s"), RMessageForError(RErrorCode));
-               wAbort(False);
-       } else {
-               char **formats;
-               int i = 0;
-
-               formats = RSupportedFileFormats();
-               if (formats) {
-                       for (i = 0; formats[i] != NULL; i++) {
-                               if (strcmp(formats[i], "TIFF") == 0) {
-                                       scr->flags.supports_tiff = 1;
-                                       break;
-                               }
-                       }
-               }
-       }
-
        scr->w_win = scr->rcontext->drawable;
        scr->w_visual = scr->rcontext->visual;
        scr->w_depth = scr->rcontext->depth;
diff --git a/src/screen.h b/src/screen.h
index be27cdb..8dbddee 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -301,7 +301,6 @@ typedef struct _WScreen {
         unsigned int added_workspace_menu:1;
         unsigned int added_windows_menu:1;
         unsigned int startup2:1;       /* startup phase 2 */
-        unsigned int supports_tiff:1;
         unsigned int next_click_is_not_double:1;
         unsigned int backimage_helper_launched:1;
         /* some client has issued a WM_COLORMAP_NOTIFY */
diff --git a/src/startup.c b/src/startup.c
index 5f906c7..c39ecaf 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -478,7 +478,8 @@ static char *atomNames[] = {
 void StartUp(Bool defaultScreenOnly)
 {
        struct sigaction sig_action;
-       int j, max;
+       int i, j, max;
+       char **formats;
 #ifdef HAVE_XRANDR
        int dummy;
 #endif
@@ -690,6 +691,17 @@ void StartUp(Bool defaultScreenOnly)
 
        wScreenCount = 0;
 
+       /* Check if TIFF images are supported */
+       formats = RSupportedFileFormats();
+       if (formats) {
+               for (i = 0; formats[i] != NULL; i++) {
+                       if (strcmp(formats[i], "TIFF") == 0) {
+                               wPreferences.supports_tiff = 1;
+                               break;
+                       }
+               }
+       }
+
        /* manage the screens */
        for (j = 0; j < max; j++) {
                if (defaultScreenOnly || max == 1) {
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to