Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: daniloz on May 24, 2012, 04:10:57 pm
-
Hi All,
I've found a bug when opening a file and jumping to a line from command line. It occurs if the file is already open in C::B, but it's not the last file opened, so steps to reproduce it:
1- open C::B ;-)
2- open file A
3- open file B
4- run codeblocks.exe --file=file_A:20
5- file A has the focus, but the cursor of file B is at line 20 and not the one of file A
The bug is straightforward to see and it's corrected in the patch attached.
This patch also maximize the C::B window in case it's minimized, before raising it. (related to http://forums.codeblocks.org/index.php/topic,14517.0.html (http://forums.codeblocks.org/index.php/topic,14517.0.html))
-
The bug is confirmed, on linux, too...I'll test the patch in a minute
p.s. The general rule is to not mix unrelated changes in a single patch, thus it minimizes the work the people testing the patch have to do...
-
p.s. The general rule is to not mix unrelated changes in a single patch, thus it minimizes the work the people testing the patch have to do...
Sorry about that... :-)
I was so excited that I solved both "problems" that I wanted to share it asap...
Should I break the patch into two?
-
No, I doubt that forcing the maximizing is the right thing to do, but you should provide a patch there, where the context is correct.
I'll commit your --file patch in a minute... Done...
-
Btw: Instead of IsMaximized() you should check for !IsIconised() and issue a Show() then... IMHO that's the better option. Notice the Iconised, not Iconized... ;-)
But what was actually the bug here?
-
Morten: See the link in the first post :) and post any comments there as this will make it less random and easier if someone searches for this problem...
-
Morten: See the link in the first post :) and post any comments there as this will make it less random and easier if someone searches for this problem...
Oops - I missed that link. I thought its related to the primary issue. ::)
-
No, I doubt that forcing the maximizing is the right thing to do, but you should provide a patch there, where the context is correct.
Continuing the discussion on the original thread, then, as suggested.... ;D