# Not able to set window position

**URL:** <https://discourse.glfw.org/t/not-able-to-set-window-position/166>\
**Category:** support\
**Created:** [July 29, 2015, 10:44pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166 "2015-07-29T22:44:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 10:44pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/1 "2015-07-29T22:44:52Z")

</div>

**[sheeri185adidam](https://sourceforge.net/u/sheeri185adidam/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#d2f0):

Hi,

I am creating a window without the border by setting window hint GLFW\_DECORATED to false.  
If I am not wrong, this is not a fullscreen window but borderless window, right ?  
The documentation says that we can not move(set position) fullscreen window.

I tried to move this borderless window by using glfwSetWindowPos() function but the window does not move.  
Any idea what is wrong here ?

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:09pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/2 "2015-07-29T23:09:13Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#2579):

Did you specify a monitor?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:15pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/3 "2015-07-29T23:15:16Z")

</div>

**[sheeri185adidam](https://sourceforge.net/u/sheeri185adidam/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#0953):

no. I did not.  
I don’t want fullscreen windows but borderless ones.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:24pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/4 "2015-07-29T23:24:44Z")

</div>

**[sheeri185adidam](https://sourceforge.net/u/sheeri185adidam/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#ff8c):

this is on X windows (suse linux)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:25pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/5 "2015-07-29T23:25:43Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#fa5b):

Are you moving the window before or after you show it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:28pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/6 "2015-07-29T23:28:24Z")

</div>

**[sheeri185adidam](https://sourceforge.net/u/sheeri185adidam/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#2bf3):

I am trying to move the window immediately after creating it.

window\_handle\_ = glfwCreateWindow(bounds\_.width, bounds\_.height, name\_.c\_str(),NULL,NULL);  
glfwSetWindowPos(window\_handle\_, bounds\_.x, bounds\_.y);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 29, 2015, 11:40pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/7 "2015-07-29T23:40:14Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, July 29, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#01ff):

Window managers are free to override window placement. Perhaps yours is.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 30, 2015, 12:05am UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/8 "2015-07-30T00:05:54Z")

</div>

**[sheeri185adidam](https://sourceforge.net/u/sheeri185adidam/)** wrote on [Thursday, July 30, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#be71):

makes sense.  
Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 30, 2015, 2:06am UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/9 "2015-07-30T02:06:55Z")

</div>

**[arampl](https://sourceforge.net/u/arampl/)** wrote on [Thursday, July 30, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#03f9):

Try to set window position twice like this:

```auto
glfwSetWindowPos(mainwindow, posx, posy);
glfwShowWindow(mainwindow);
glfwSetWindowSize(mainwindow, width, height);
glfwSetWindowPos(mainwindow, posx, posy);

```

Helped me on Linux (Xubuntu). (mainwindow is initially invisible)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 30, 2015, 9:22am UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/10 "2015-07-30T09:22:15Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, July 30, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#7f60):

Is it a small window or big? Where are you trying to move it to and why? Are you calculating the position and if so have you verified that it’s sane?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 30, 2015, 3:24pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/11 "2015-07-30T15:24:38Z")

</div>

**[arampl](https://sourceforge.net/u/arampl/)** wrote on [Thursday, July 30, 2015](https://sourceforge.net/p/glfw/discussion/247562/thread/3f62acfb/#a2c5):

Maybe OP just wanted his own window decorations - title bar, window buttons - and allow user to move this window around by dragging like normal window.

My application works fine with and without decorations, no matter what window size, even if it is partially outside screen or wider/taller. Can switch to fullscreen and back without problems.

I save last position and size of the window in external file on exit and load this values on start.

Already tested it once more without decorations - it appears exactly where I want it to be on start and can be moved to anywhere during execution with glfwSetWindowPos.

My own purpose for this is trivial - application must remember its window (maybe multiple windows) layout from last session. Never liked apps that don’t do that. For example I must always reposition and resize pdf viewer (Evince) to read books comfortably.

---

<div class="post-metadata">

**Author:** ![hegworks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/hegworks/32/982_2.png) [@hegworks](https://discourse.glfw.org/u/hegworks)\
**Post date:** [November 16, 2024, 7:50pm UTC](https://discourse.glfw.org/t/not-able-to-set-window-position/166/12 "2024-11-16T19:50:03Z")

</div>

this worked for me! thank you so much
