Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window does not activate if you click inside it  (Read 16237 times)

0 Members and 1 Guest are viewing this topic.

farooqaaa

  • Newbie
  • *
  • Posts: 1
    • View Profile
Window does not activate if you click inside it
« on: August 16, 2013, 03:37:34 am »
Does anyone have this problem? Here's a gif that shows I am talking about:

http://i.imgur.com/dcTZyTG.gif

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Window does not activate if you click inside it
« Reply #1 on: August 16, 2013, 04:14:45 am »
https://github.com/SFML/SFML/issues/437 I think this is the issue you are talking about. It was introduced by accident in 2.1, and will hopefully be fixed in 2.2.
I use the latest build of SFML2

JuDelCo

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • JuDelCo's Twitter
Re: Window does not activate if you click inside it
« Reply #2 on: September 14, 2013, 12:17:44 am »
Same here (I'm using v2.1 too)

I'll wait for the 2.2 release then ^^

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Window does not activate if you click inside it
« Reply #3 on: September 14, 2013, 12:20:41 am »
Does anyone have this problem?
The search is usually very good at answering such questions. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Vicker

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Window does not activate if you click inside it
« Reply #4 on: September 16, 2013, 07:52:54 am »
Does anyone have this problem?
The search is usually very good at answering such questions. ;)

I'm glad he posted this.  I'm having the same problem, and stumbled upon this post while looking for a solution.

I'd like to chime in that this is a major problem for my implementation.  I'm mixing SFML with a GTK+, with one SFML window and one GTK+ controlled window, and the player needs to be able to switch back and forth between them in a non-convoluted manner.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: Window does not activate if you click inside it
« Reply #5 on: September 16, 2013, 11:24:13 am »
I'm glad he posted this.  I'm having the same problem, and stumbled upon this post while looking for a solution.
There are at least 3 other threads about this bug... ;)

I'd like to chime in that this is a major problem for my implementation.  I'm mixing SFML with a GTK+, with one SFML window and one GTK+ controlled window, and the player needs to be able to switch back and forth between them in a non-convoluted manner.
Well it's a bug and it will get addressed, most likely for the next version of SFML. Currently you can either down grade to SFML 2.0 or revert the breaking change in your own SFML version or find a fix for it - unfortunately there doesn't seem to be one (check out the issue on the issue tracker).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window does not activate if you click inside it
« Reply #6 on: September 16, 2013, 11:51:07 am »
There is a pull request waiting to be merged, that fixes this bug.
Laurent Gomila - SFML developer

Vicker

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: AW: Re: Window does not activate if you click inside it
« Reply #7 on: September 16, 2013, 03:13:06 pm »
Well it's a bug and it will get addressed, most likely for the next version of SFML. Currently you can either down grade to SFML 2.0 or revert the breaking change in your own SFML version or find a fix for it - unfortunately there doesn't seem to be one (check out the issue on the issue tracker).

Oh, I'm not in a huge rush.  It'll be quite a while before I work out the other kinks in this goofy idea of mine, so hopefully it'll be fixed by then.  I'm glad to hear that it's getting fixed.

Demir

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: Window does not activate if you click inside it
« Reply #8 on: September 17, 2013, 09:23:56 am »
I think "On-Screen Keyboard" programs need this property (bug) . :)

can it be useful for this purpose?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Window does not activate if you click inside it
« Reply #9 on: February 02, 2014, 08:19:37 pm »
I'm sorry for resurrecting an old thread; I believe it's still relevant, however, as the problem still exists. (I'm aware that this is being fixed in the library)

I ended up on this thread because I was having this problem too. I came back because I found a simple workaround. It may be bad practice but it seems to work until the fix is applied.

This is for Windows only. You'll also need to
#include <Windows.h>

If, in your main loop, you put the code:
SetForegroundWindow(renderWindow.getSystemHandle());
with "renderWindow" being your RenderWindow object, it should allow you to click the client area to refocus the window. Oddly, it doesn't actually set the focus of the window or activate it by itself as it is supposed to.

I hope this helps for now. I'm looking forward to the new version of SFML (hopefully with a VS2013 build as my build seemed to fail at creating debug libraries :( )
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Window does not activate if you click inside it
« Reply #10 on: February 02, 2014, 08:45:41 pm »
And I don't know how many other times this has been stated around the forums.... it has been fixed for months already in the github source code.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Window does not activate if you click inside it
« Reply #11 on: February 02, 2014, 09:14:32 pm »
But not in the current release?
I'm new and I've been using C++ and SFML for only a few days after I had to build it from the source code myself. I found that this workaround temporarily fixes the problem until the latest version has the proper fix.

That said, I have no idea what github is.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Window does not activate if you click inside it
« Reply #12 on: February 02, 2014, 10:14:55 pm »
That said, I have no idea what github is.
Github is a beautiful place.

SFML's Github page
« Last Edit: February 02, 2014, 10:17:26 pm by dabbertorres »

AN71

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Window does not activate if you click inside it
« Reply #13 on: February 03, 2014, 06:18:09 am »
That said, I have no idea what github is.
Github is a beautiful place.


Agreed, but to elaborate (at least in layman's terms) Github is a place for people to host source code based on the Git SCM system. People can write commits, and share ideas, it is one of the quintessential pieces of Open Source in my opinion. However, I suppose they still do have private repositories. There is still a lot more to it, though I don't believe its really necessary to cover it all. ;)
edit:Disclaimer: Although I'm pretty new to SFML, I've used Github for a while
« Last Edit: February 03, 2014, 06:25:59 am by Raze »
Quote from: Friedrich Nietzsche
He who would learn to fly one day must first learn to stand and walk and run and climb and dance; one cannot fly into flying.

Moberg

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Window does not activate if you click inside it
« Reply #14 on: February 11, 2014, 12:46:09 pm »
This is not fixed yet. Why isn't there a new release? Or some info/guide about this on the download site?

Quickest way to fix?