aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--util/fbrun/FbRun.cc8
-rw-r--r--util/fbrun/FbRun.hh5
-rw-r--r--util/fbrun/main.cc2
4 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fddd45..8eebecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.16: 2Changes for 0.9.16:
3*06/04/17: 3*06/04/17:
4 * Fix fbrun position setting (-pos and -nearmouse args) (Simon)
5 util/fbrun/... FbRun.hh/cc main.cc
4 * Resize the clock if the text gets too big, sf.net patch #1436406 6 * Resize the clock if the text gets too big, sf.net patch #1436406
5 (thanks Geoff Lywood - glywood at users.sourceforge.net) 7 (thanks Geoff Lywood - glywood at users.sourceforge.net)
6 ClockTool.cc 8 ClockTool.cc
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index 281b35f..41c7474 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -215,7 +215,6 @@ void FbRun::setTitle(const string &title) {
215 215
216void FbRun::resize(unsigned int width, unsigned int height) { 216void FbRun::resize(unsigned int width, unsigned int height) {
217 FbTk::TextBox::resize(width, height); 217 FbTk::TextBox::resize(width, height);
218 setNoMaximize();
219} 218}
220 219
221void FbRun::redrawLabel() { 220void FbRun::redrawLabel() {
@@ -285,7 +284,7 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
285 clear(); 284 clear();
286} 285}
287 286
288void FbRun::setNoMaximize() { 287void FbRun::lockPosition(bool size_too) {
289 // we don't need to maximize this window 288 // we don't need to maximize this window
290 XSizeHints sh; 289 XSizeHints sh;
291 sh.flags = PMaxSize | PMinSize; 290 sh.flags = PMaxSize | PMinSize;
@@ -293,6 +292,11 @@ void FbRun::setNoMaximize() {
293 sh.max_height = height(); 292 sh.max_height = height();
294 sh.min_width = width(); 293 sh.min_width = width();
295 sh.min_height = height(); 294 sh.min_height = height();
295 if (size_too) {
296 sh.flags |= USPosition;
297 sh.x = x();
298 sh.y = y();
299 }
296 XSetWMNormalHints(m_display, window(), &sh); 300 XSetWMNormalHints(m_display, window(), &sh);
297} 301}
298 302
diff --git a/util/fbrun/FbRun.hh b/util/fbrun/FbRun.hh
index fb23a3a..f34f691 100644
--- a/util/fbrun/FbRun.hh
+++ b/util/fbrun/FbRun.hh
@@ -66,6 +66,9 @@ public:
66 void keyPressEvent(XKeyEvent &ev); 66 void keyPressEvent(XKeyEvent &ev);
67 ///@} 67 ///@}
68 68
69 /// set no maximizable for this window
70 void lockPosition(bool size_too);
71
69private: 72private:
70 void nextHistoryItem(); 73 void nextHistoryItem();
71 void prevHistoryItem(); 74 void prevHistoryItem();
@@ -73,8 +76,6 @@ private:
73 void getSize(size_t &width, size_t &height); 76 void getSize(size_t &width, size_t &height);
74 void createWindow(int x, int y, size_t width, size_t height); 77 void createWindow(int x, int y, size_t width, size_t height);
75 void redrawLabel(); 78 void redrawLabel();
76 /// set no maximizable for this window
77 void setNoMaximize();
78 79
79 void insertCharacter(char key); 80 void insertCharacter(char key);
80 void adjustStartPos(); 81 void adjustStartPos();
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc
index 06ec644..878b5eb 100644
--- a/util/fbrun/main.cc
+++ b/util/fbrun/main.cc
@@ -205,6 +205,8 @@ int main(int argc, char **argv) {
205 205
206 if (set_pos) 206 if (set_pos)
207 fbrun.move(x, y); 207 fbrun.move(x, y);
208
209 fbrun.lockPosition(set_pos);
208 210
209 fbrun.show(); 211 fbrun.show();
210 212