summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/fbrun/FbRun.cc8
-rw-r--r--util/fbrun/FbRun.hh5
-rw-r--r--util/fbrun/main.cc2
3 files changed, 11 insertions, 4 deletions
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