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

supports_tiff moved to wPreferences

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.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-09-05 21:08:16 +02:00
committed by Carlos R. Mafra
parent 82aea844d0
commit 4e4d75c55e
5 changed files with 15 additions and 21 deletions

View File

@@ -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 */

View File

@@ -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)

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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) {