diff options
Diffstat (limited to 'src/WindowState.cc')
-rw-r--r-- | src/WindowState.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/WindowState.cc b/src/WindowState.cc index 50a88fc..d062907 100644 --- a/src/WindowState.cc +++ b/src/WindowState.cc | |||
@@ -23,7 +23,17 @@ | |||
23 | 23 | ||
24 | #include "FbTk/StringUtil.hh" | 24 | #include "FbTk/StringUtil.hh" |
25 | 25 | ||
26 | #include <stdlib.h> | 26 | #ifdef HAVE_CONFIG_H |
27 | #include "config.h" | ||
28 | #endif // HAVE_CONFIG_H | ||
29 | |||
30 | #ifdef HAVE_CSTDLIB | ||
31 | #include <cstdlib> | ||
32 | #else | ||
33 | #include <stdlib.h> | ||
34 | #endif | ||
35 | |||
36 | #include <errno.h> | ||
27 | 37 | ||
28 | bool WindowState::useBorder() const { | 38 | bool WindowState::useBorder() const { |
29 | return !fullscreen && maximized != MAX_FULL && deco_mask & DECORM_BORDER; | 39 | return !fullscreen && maximized != MAX_FULL && deco_mask & DECORM_BORDER; |
@@ -92,10 +102,14 @@ int WindowState::getDecoMaskFromString(const std::string &str_label) { | |||
92 | return DECOR_BORDER; | 102 | return DECOR_BORDER; |
93 | if (label == "tab") | 103 | if (label == "tab") |
94 | return DECOR_TAB; | 104 | return DECOR_TAB; |
105 | |||
95 | int mask = -1; | 106 | int mask = -1; |
96 | if ((str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x') || | 107 | int tmp; |
97 | (str_label.size() > 0 && isdigit(str_label[0]))) | 108 | errno = 0; |
98 | mask = strtol(str_label.c_str(), NULL, 0); | 109 | tmp = strtol(str_label.c_str(), NULL, 0); |
110 | if (errno == 0) | ||
111 | mask = tmp; | ||
112 | |||
99 | return mask; | 113 | return mask; |
100 | } | 114 | } |
101 | 115 | ||