Bug#482952: yakuake: Move tab left/right hotkey moves the previous visited tab

2009-04-24 Thread jrw
On Wed, Apr 22, 2009 at 11:20 AM, Ana Guerrero  wrote:
> On Tue, Apr 21, 2009 at 07:43:36PM +0100, jrw wrote:
>> Tags: patch
>>
>> I completely forgot about this bug, sorry :)  Maybe it's too obsolete now...
>>
>> This patch changes the name of a bunch of variables (kde code is hard
>> to understand), adds docs, and (to actually fix the bug), adds a
>> signal itemSelected -> slotResetAffect... This resets the affect
>> position pointer every time we select a new view so operations happen
>> on the new view until the user makes a new right click.  I also
>> removed some calls to the reset function which are redundant now.
>>
>> This also fixes moving a tab after moving *to* a different tab using
>> shift+arrow which I didn't notice in the original report.
>
> I forgot about it too, so.. :)
> Current yakuake version is 2.9.4 made to work with KDE 4.2 in unstable, did
> you made the patch against the KDE 3 version of the current KDE 4 one?
> FWIW, I can not reproduce your problem in current KDE 4 from unstable.
>
>
> Ana
>

The patch is against the kde3 version 2.8.1-1.

I don't really want to install all of kde4 to test this bug is fixed;
it's a 100mb download and I'm still a bit nervous about losing the
functions I rely on currently ;).  Just in case I wasn't exact enough,
here is a precise sequence which triggers the bug:

- open yakuake
- open a new terminal
- click on the first terminal
- open a new terminal
- ctrl+shift left
-> nothing happens (it's trying to move terminal #1 left)
- ctrl+shift left again
-> now the current terminal moves

If it is fixed... well, no harm I guess, but it would be nice to see a
2.8.1-2 for the kde3 holdouts (or perhaps even yakuake-kde3 package?).

Thanks for your attention.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#482952: yakuake: Move tab left/right hotkey moves the previous visited tab

2009-04-21 Thread jrw
Tags: patch

I completely forgot about this bug, sorry :)  Maybe it's too obsolete now...

This patch changes the name of a bunch of variables (kde code is hard
to understand), adds docs, and (to actually fix the bug), adds a
signal itemSelected -> slotResetAffect... This resets the affect
position pointer every time we select a new view so operations happen
on the new view until the user makes a new right click.  I also
removed some calls to the reset function which are redundant now.

This also fixes moving a tab after moving *to* a different tab using
shift+arrow which I didn't notice in the original report.
diff --git a/yakuake/src/main_window.cpp b/yakuake/src/main_window.cpp
index 7a15bde..62e8703 100644
--- a/yakuake/src/main_window.cpp
+++ b/yakuake/src/main_window.cpp
@@ -380,10 +380,9 @@ void MainWindow::slotRemoveSession(int session_id)
 void MainWindow::slotHandleRemoveSession(KAction::ActivationReason reason, Qt::ButtonState /* state */)
 {
 if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
 {
-slotRemoveSession(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotRemoveSession(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
 }
 else
 slotRemoveSession();
@@ -653,10 +652,9 @@ void MainWindow::windowActivationChange(bool old_active)
 void MainWindow::slotHandleHorizontalSplit(KAction::ActivationReason reason, Qt::ButtonState /* state */)
 {
 if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
 {
-slotSplitHorizontally(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotSplitHorizontally(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
 }
 else
 slotSplitHorizontally();
@@ -665,10 +663,9 @@ void MainWindow::slotHandleHorizontalSplit(KAction::ActivationReason reason, Qt:
 void MainWindow::slotHandleVerticalSplit(KAction::ActivationReason reason, Qt::ButtonState /* state */)
 {
 if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
 {
-slotSplitVertically(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotSplitVertically(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
 }
 else
 slotSplitVertically();
@@ -678,10 +675,9 @@ void MainWindow::slotHandleVerticalSplit(KAction::ActivationReason reason, Qt::B
 void MainWindow::slotHandleRemoveTerminal(KAction::ActivationReason reason, Qt::ButtonState /* state */)
 {
 if (reason == KAction::PopupMenuActivation
-&& tab_bar->pressedPosition() != -1)
+&& tab_bar->affectPosition() != -1)
 {
-slotRemoveTerminal(tab_bar->sessionIdForTabPosition(tab_bar->pressedPosition()));
-tab_bar->resetPressedPosition();
+slotRemoveTerminal(tab_bar->sessionIdForTabPosition(tab_bar->affectPosition()));
 }
 else
 slotRemoveTerminal();
@@ -1323,7 +1319,7 @@ void MainWindow::slotPollMouse()
 
 if (pos.y() == 0)
 {
-if (Settings::screen() == 0) 
+if (Settings::screen() == 0)
 slotToggleState(); // no need to check x since yakuake should open where the mouse pointer is
 else if (pos.x() >= getDesktopGeometry().x() && pos.x() <= (getDesktopGeometry().x() + getDesktopGeometry().width()))
 slotToggleState();
diff --git a/yakuake/src/tab_bar.cpp b/yakuake/src/tab_bar.cpp
index 72347db..52aa26b 100644
--- a/yakuake/src/tab_bar.cpp
+++ b/yakuake/src/tab_bar.cpp
@@ -21,7 +21,6 @@
 #include 
 #include 
 
-
 TabBar::TabBar(QWidget* parent, const char* name, bool translucency, const QString & skin)
 : TranslucentWidget(parent, name, translucency)
 {
@@ -41,15 +40,9 @@ TabBar::~TabBar()
 delete minus_button;
 }
 
-int TabBar::pressedPosition()
-{
-return tabs_widget->pressedPosition();
-}
-
-
-void TabBar::resetPressedPosition()
+int TabBar::affectPosition()
 {
-tabs_widget->resetPressedPosition();
+return tabs_widget->affectPosition();
 }
 
 void TabBar::addItem(int session_id)
diff --git a/yakuake/src/tab_bar.h b/yakuake/src/tab_bar.h
index 6e8f3a0..2e05449 100644
--- a/yakuake/src/tab_bar.h
+++ b/yakuake/src/tab_bar.h
@@ -41,8 +41,8 @@ class TabBar : public TranslucentWidget
 
 void setSessionMenu(KPopupMenu* menu);
 
-int pressedPosition();
-void resetPressedPosition();
+int affectPosition();
+// void resetAffectPosition();
 
 void addItem(int session_id);
 int removeItem(int session_id);
diff --git a/yakuake/src/tabbed_widget.cpp b/yakuake/src/tabbed_widget.cpp
index c2b3961..46c4649 100644
--- a/yakuake/src/tabbed_widget.cpp