Unable to maximize window after selecting "run minimized" option

Bug #930538 reported by BubbaJ
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bt-autoconnect
Fix Released
Medium
Takkat

Bug Description

I have been looking for a tool to automatically connect my BT headset and change the input/output to the headset automatically after connected. I found your application after doing some searching. I am able to get the application to auto connect to my headset after it is turned on. The application also routes the audio input/output correctly to the headset after connecting.

I have set the application to start at startup. I also checked the box to "run minimized at startup". The problem I am having now is that I am not able to maximize the application window. Clicking on the icon in the Ubuntu launcher or clicking on the "Show window" option from the drop down in the notification area do not display the dialog box. Even if I quit the application and restart, or reboot the system and restart does not work.

The laptop is used by three different family members. I use fast user switching in Ubuntu to switch between accounts. Not sure if this is an issue for the application or not, but each user may want to have the app running to allow auto connect to the BT headset. Let me know if you need any further detail. Thanks.

Revision history for this message
Takkat (takkat-nebuk) wrote :

The issue should be fixed in release 0.1.6

Thank you for your help.

Changed in bt-autoconnect:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Takkat (takkat-nebuk)
Revision history for this message
BubbaJ (azstuenthome) wrote :

Takkat, I see that you posted a fix to the issue. Thanks for the quick response. I downloaded and installed 0.1.6. I am still having the issue in some cases after installing the latest release. When I first installed the package, and before connecting, I was able to maximize/minimize the window without any problem. I then tried connecting to the headset. The connection worked correctly and I was still able to maximize the window. I tried connecting and disconnecting and everything was working correctly.

I then tried switching over to another user on the same system. I setup bt-autoconnect to run at startup so that it is up and ready anytime for each user that logs in. Somewhere between logging out and logging in between users several times, the bt-autoconnect application would no longer maximize. When this occurred, the BT headset would still connect and disconnect and route the audio correctly, but I could not maximize the application.

After quitting and restarting the app, I was again able to maximize the window. Somewhere it seems to be getting stuck. In order for it to work for each user, I've enabled it at startup. That should be fine, right? I had a question about the "interval to scan" setting. Can you explain what that is for? Is it the interval to scan after the BT connection is first initiated, and each time the BT connection is initiated, it will scan for this duration? Or the interval to scan after the app is initiated? I'd like the app to be up and running all the time so whenever the headset it turned on / off it will automatically connect. I'd only use the headset when I want to use my voip app.

Let me know if there is any further information I can provide.

Thinkpad T42, Ubuntu 11.10 using Compiz 3D.

Revision history for this message
Takkat (takkat-nebuk) wrote :

I do believe this is rather an issue of the desktop manager than of bt-autoconnect. There was considerable changes in the way windows are handled. That's why we couldn't maximize in 11.10 (where it still is fine in 11.04). This should be fixed by now. User switching still has issues that can not so easily be overcome and may be the cause of your issues. Sorry to say that in that case I have no clue where to look for.

If you installed the application via the Debian package it will also display a launcher icon. You can then always maximize it from there in case the panel Indicator is not responsive.

The time value is the interval in seconds the application looks up whether the device at a given MAC is alive. The shorter this time the faster a connection can be established but more of your CPU will be wasted. It is rather empirical, 4s being a reasonable time with my hardware. Setting the time too short could result in unwanted side effects from delays inherent to Bluez and Pulseaudio. There is no reason why you should not try out different values until you are happy.

Dont hesitate to give me ideas for any further improvements.

Revision history for this message
BubbaJ (azstuenthome) wrote :

Thanks for the response. I've played around a little more with the application. It seems that the problem with not being able to maximize is related to starting bt-autoconnect at startup. If I don't include it in the login startup list, and start it later, I don't have the issue with being able to maximize.

By the way, you mentioned trying to maximize using the launch icon. I did install using the debian package. When the issue exists, clicking on the launch icon also fails to maximize the window.

I have a couple of suggestions. One would be to have the option to select to run the program at startup so that it's active by default. This would be similar to the bluetooth manager, or network manager. These applications don't have an associated launcher icon when running.

Another suggestion would be to have the option to store multiple MAC addresses for multiple bt headsets. I have multiple headsets that I may want to switch between. Then you could use a drop down to choose which to use for the connection. If I think of more, I'll let you know.

Takkat (takkat-nebuk)
Changed in bt-autoconnect:
status: Fix Released → Triaged
Revision history for this message
Takkat (takkat-nebuk) wrote :

Oh that was a good point. I can confirm the behaviour when starting from autostart. This is rather annoying as the application is designed to run from there. The windows iconify method from gtk is the culprit here.

To fix this we need to edit the following line in the python source from v 1.6.
294 - window.iconify()
294 + window.hide()
located in /usr/share/pyshared/bt-autoconnect/bt-autoconnect.py.

If we prefer not to have a launcher icon on startup we can delete the bt-autoconnect.desktop file from /usr/share/applications. However then the program can only be run from command line as Dash depends on this .desktop file. The panel icon will still be rendered. To be compatible with systems that may not provide Application Indicators from Unity we can not make this a default behaviour.

The patch above will be included in the next release. If I find the time I may also include an option to make autostart selectable, that is a good idea indeed.

Rather than selecting from multiple headsets some sort of autodetection of any attached Bluetooth audio device will make life easier. I already have an idea on how to do this.

Thank you for your suggestions.

Revision history for this message
Takkat (takkat-nebuk) wrote :

See also bug #932580

Takkat (takkat-nebuk)
Changed in bt-autoconnect:
status: Triaged → Fix Released
Revision history for this message
Takkat (takkat-nebuk) wrote :

Fix for not showing window after running from autostart released in v. 0.1.7.

Added option to run minimized from autostart.

Auto-scan BT-neigbourhood for an audio device and connect if any is found (to enable this new feature just enter 'Auto' instead of MAC).

We could test the new version with a single BT device on 11.04., 11.10. 12.04 only. Please report any problems that may occur for several Bluetooth devices.

Revision history for this message
BubbaJ (azstuenthome) wrote :

Takkat, I downloaded the latest version and installed it. The issue with not being able to maximize the window after it has been initiated in the Startup Application list seems to be corrected. Now when the program is initiated as a Startup Application and it is minimized, I am able to later maximize the window using the "Show Window" option from the notification area. Then I noticed that when it is minimized, the icon appears in the launcher and I am able to maximize from the launcher.

I tried removing the MAC address from the dialog box and replacing with the word "Auto". This seems to work as the application still connects to the headset. This is a much more flexible option as it would theoretically look for any BT headset. I tested with a second headset that is paired with the laptop and was able to auto connect using the "Auto" option without ever having to enter my MAC address.

I would suggest making the "Auto" option the default and let the user enter a specific MAC address if they want to restrict the connection to a particular headset. This makes the setup less tedious. I see you updated the text overlay when you hover over the MAC to indicate that entering 'Auto' for auto-detection.

I see the new option for "Autorun minimized on login". This is in the same area that used to have the checkbox for minimize at startup. I was not clear what the difference is in the new option. By selecting the checkbox, I expected the application to run at Startup, but it did not. I had to manually go into Startup Applications to check the box to have it run. Previously I had manually moved the bt-autoconnect.desktop file to the /etc/xdg/autostart directory in order for it to appear in the Startup Application list. Will this happen automatically now with the new option? The wording of the option leads me to believe that if I check the box, it will automatically run at login (or Startup) and it will run minimized. Maybe I'm not understanding it correctly. Can you explain the new option please?

Revision history for this message
Takkat (takkat-nebuk) wrote :

Thank you for the feedback, glad it works. I'll keep the 'Auto' option as default settings in mind for the next relelase.

The new settings combine the former 'run minimized' with autostart, as this is when running minimized makes sense. To do so bt-autoconnect connects from userspace rather than from xdg by creating its .desktop file in ~/.config/autostart. By default the autostart option should then be set 'true'.

Can you please test this on your system by following steps:

1. Run bt-autoconnect
2. Untick the autostart option
3, 'Quit' the application.
4. Restart bt-autoconnect to select autostart.
5. 'Quit' bt-autoconnect.
6. Logout your user and log back in.

By doing so we make shure that the .desktop file is replaced with the default. You may have to remove your autostart file from /etc/xdg/autostart first.

Thank your for helping!

Revision history for this message
BubbaJ (azstuenthome) wrote :

I just tried your suggestion about removing the .desktop file I had placed in the /etc/xdg/autostart directory, then following the steps you outlined above. I verified that the application starts on my laptop at login when the box is ticked and does not start when the box is unticked. I noticed that the .desktop file was being added and removed from the .config/autostart directory as the box was ticked and unticked. It seems to be working as expected now.

As I mentioned before, I was somewhat confused by the wording of the new option. I like having the ability to have the included in the startup list. I also agree with you that it makes sense to run it minimized this way with only the icon in the notification area. Since as you mentioned, there is no option to autorun maximized at login, it might be more clear to say "Include in Startup Applications" or "Run as Startup Application". It's just a thought to consider.

As I executed the steps above, I was thinking about the "save" option. Presently in order to "save" the changes, you have to hit the "Quit" button. It's not intuitive to have to do this in order to save changes. In general the term "quit" implies that changes will not be saved. I know you have text that appears when you hover over the Quit button indicate that the settings will be saved. Is there a way to save the settings automatically as is the case in other Ubuntu settings dialog boxes? If there was a way to save changes as soon as the focus changed to another area of the dialog box or after the mouse is moved, or some fixed time after a change is made. This would make the usability more consistent with other System Settings dialog boxes.

Again, I think this is a great application that many could benefit from. Thanks again for being open to the consideration for improvements.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Bubbaj: thank you again for testing, glad it works as expected now.

The reasons I had for not having a 'Save settings' button were the following:

 * I deliberatedly wanted to keep the application's GUI as lean and simple as possible.
 * The application window basically is a setup dialog only.
 * Once settings are made we do not need this window at all (when running minimized).

Saving the settings on 'Quit' only indeed is not very intuitive as we may want to keep the application alive after we made our changes. In addition if we do not deliberately 'Quit' it later our settings may be lost.

What is your opinion on having an additional 'Save & Minimize' button?

Revision history for this message
BubbaJ (azstuenthome) wrote :

I appreciate your concern for keeping the program and setup dialog as lean and as simple as possible. I agree that after the initial setup, there should be little to no need to raise the setup window. Regarding the "Save and Minimize" option, I would actually prefer to just have an option to "Save" without requirement to minimize the the dialog box. This would allow the user to make a change, save it, see the impact, make another change, save it, see the impact without each time having to re-open the dialog box. This would make the user interaction more consistent with the typical settings dialog box where a change can be made and is automatically saved as soon as the focus is changed.

From your note above it sounds like the "auto save" option requires more coding to support than just adding a "Save" option. The preferred option would be to "auto save" without having to select a button to save. If this makes the code more complex, the second preferred option would be to just have a "Save" option that would leave the dialog open. To keep things consistent with other settings dialogs, you would not require a separate "minimize" option button as this is inherently available on all standard dialog boxes and the user already expects to use the main window dialog minimize button ( _ ) in the top corner to minimize the window if needed.

For the same reason, if you include a "Save" button/option, you could eliminate the "Quit" button as the user would know already expect that he could select the main dialog ( X ) button to quit (without saving) if desired. This would help accomplish your goal of keeping the dialog box lean and as simple as possible without having to add additional buttons.

As I've been using the application more, I had another idea. I find that sometimes the headset does not auto connect. Generally when this happens, its not the fault of the bt-autoconnect but rather is due to the fact that the headset is not making the main BT connection to the laptop. When this happens, I generally will open the BT Manager dialog box to see if the headset is connecting or attempting to connect to the laptop. What do you think about the idea of having an additional icon color for bt-autoconnect that would change color when bt-autoconnect "sees" the headset is visible / attempting to make the main connection to the laptop. The three colors of the bt-autoconnect icon could be 1) white - no connection, no headset visible, 2) green - no connection, but headset visible. This color could indicate that the headset is visible or actively attempting connection, 3) blue - connected and audio routed to the headset.

Thanks again for your time and consideration of my input.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Thank you for your great suggestions.

I do agree that minimizing, or quitting could also be done from windows controls. I feel however that any dialog should alwas have at least one button that makes it disappear in addition. At the moment 'Quit' will save settings and terminate the program. Just closing the window closes the program but without saving (to give us a chance to abort edits).

A 'Save' button is already added for the next release to make clear what we do.

An auto-save feature would indeed need considerable additional coding that may not be worth the effort. Saving everytime at the time interval given for device lookup could be done with just a line of code but this would definitely be too often. So I probably will not implement this.

I can confirm some glitches when it comes to recognizing a Bluetooth device from the Bluez enivronment. They are annoying indeed but we can't do much about this.

The idea to have a color code for devices that are being looked up vs. disconnected or connected is much to my liking. Initially I used sdptool to browse for the presence of a Bluetooth device prior to pulseaudio. Later I realized however that it will not make sense to try to connect to a device that pulseaudio does not recognize yet. Therefore we now connect as soon as the device is recognized by the pulseaudio server. By doing so we added a lot of stability but debugging a non connecting device still is a pain.

Hearing that you often browse to the Bluetooth manager to look for your device it may be a good idea to have direct acces to bluetooth preferences from bt-autoconnect. I put this on my agenda for the next release.

Thank you for supporting bt-autoconnect by adding ideas.

Revision history for this message
Takkat (takkat-nebuk) wrote :

See version 0.1.8 just released.

Revision history for this message
BubbaJ (azstuenthome) wrote :

I installed the latest version 0.1.8. I can see you've changed the titles for the buttons as well as the text associated with the checkbox. It appears as there is no help text associated with the checkbox option for adding to startup. You may want to capitalize "Startup" and "Applications" as these are proper terms associated with the OS.

I tested the "Save Settings" button and it appears that clicking the button does update the .cfg file. I also like how the dialog box remains open after pressing the save button. The "Bluetooth" button did not have any effect for me. Per your note above, I expected it to open the Bluetooth preferences in System Settings, but it did not. I could not tell that there was any action or response to pressing the button. Did it work for you in your system?

Regarding the "Quit" button. I noticed that it still has the effect of quitting the application and saving the settings. Since there is a "Save Settings" button, I expected the "Quit" button only quit the dialog without saving. I know you prefer to have the "Quit" button, but to me it is a bit redundant as the main dialog box already has a quit button integrated into the title, that users are used to using to quit a dialog box.

I'm not an application designer, but as a user, I can't recall the last time I ran into a settings type dialog box that had a button labeled quit. Do you have a settings dialog box in mind after which you are modeling this design? I think you could save the additional space, make the box more compact, and retain the usability without including the quit button.

You mentioned that you liked the idea of changing the color of the icon to a third color to indicate a change in state from not connected to in process of connecting state. Are you considering implementing something for this?

Thanks again for a great application and for your patience with my opinions. Keep up the good work.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Thank you again for your invaluable help to make the application
better. I really do appreciate this.

Bluetooth settings dialog:
My bad - I still code on 11.04 where Bluetooth preferences opens as
supposed to. From >= 11.10 however we need to call
gnome-control-center. Next update will take care on that.

Quit button:
I like to keep the 'Quit' button even though it may be redundant. Most
of the confusion arises because per design bt-autoconnect
   1) is not a stand-alone Indicator applet but rather provides an
indicator applet in addition
   2) is the only program window for people that don't have indicator
applets running (e.g. 10.04).
   3) is saving the settings on 'Quit' only to make sure they don't get lost.
   4) has too few settings for a separate preferences dialog.
In case we need to quit the program without saving the settings we may
abort program execution by just closing its window (note that this
behaviour is different to a preferences windows too).

Color code for connection state:
In 'Auto' mode there is no way to tell which device we have to look
for. It's a binary action like 'trying to connect' (grey icon) or
'connected' (blue icon). We can not code for a state in between that.
This may be different when connecting to a fixed MAC. Indeed (at least
on my system) there may be occasional cases when Bluez is connected to
a device but pulseaudio still does not recognize it. We could easily
code for indicating this with a different color. However I consider
this state to be a bug from pulseaudio as I expect an established
Bluetooth connection to be immediately available as sink in pulseaudio
(as it is in most cases). Therefore a state where a device is
recognized from the Bluez package and not recognized by pulseaudio not
exist.

Even though I quite like your idea I do hope you understand why I feel
like I should not provide code for indicating a 'buggy state'.
Basically the same holds true for Bluez not connecting to a known and
present device. Ideally there should never be a 'in progress of
connecting' state.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Version 0.1.9 released. Bluetooth preferences works for >= 11.10 only.

Revision history for this message
BubbaJ (azstuenthome) wrote :

I installed the latest version, v0.1.9. The "BlueZ Settings" button works properly now in 11.10 to open the system Bluetooth Settings dialog box. I see that you've made some changes to the settings dialog by adding and arranging buttons. I also see you've changed the button titles and added text to the checkbox option. The button titles are much more intuitively labeled now. And the overlay text that appears when you hover over the buttons is also consistent with the button text.

Just a couple of minor design items to consider. Don't fault me as I'm an engineer and it's in my blood to have things neat and aligned. The number value in the "Interval to scan" box is right justified. I thought I recall it was left justified before the latest version. It might look better to have it center justified to have the same center alignment as the "MAC" value.

Also, the "Reset Audio" and "Bluez Settings" buttons look aligned and spaced nicely. It would be more pleasing visually if the "Save Settings" and "Save & Quit" were aligned exactly under the buttons above them. All four buttons would then be in a grid pattern where the left two buttons would be center aligned vertically and the right two buttons would be also center aligned vertically. Each row of buttons would also be center aligned horizontally in their respective rows.

To take up the extra space on the left side of the dialog box after moving the "Save Settings" button to the right, you could move the "bt-autoconnect", version text, and the bluetooth icon down more toward the center, but still allowing for space between them. So that the grouping of the three would be centered vertically in the dialog box (further down from where they are currently).

I've been planning on creating a live USB of Ubuntu v12.04 to see what it's like. I can let you know how bt-autoconnect works in that version when I get a chance. Thanks again for the quick turnaround of the changes.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Thank you for the feedback.

bt-autoconnect performs nicely in 12.04.

You have my full agreement on the now somewhat cluttered design. We need further actions anyway to make sure the Bluetooth preferences dialog is available (or hidden) for people that do not run on GNOME. A redesign of the GUI can also be made by then.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Version 0.2.0 is released

Revision history for this message
Jinu John (jinujohnjoseph) wrote :

Hi
I have been using your program for quite some time and want to say it just works flawlessly. I just have a minor problem, in that I have set bt-autoconnect to start at login with ( -minimize option), but it shows the settings dialog everytime, at login.
Can u please suggest a workaround or fix for this

Thank you so much

Revision history for this message
Jinu John (jinujohnjoseph) wrote :

P.S - I'm using the latest version of bt-autoconnect v2.5

Revision history for this message
Takkat (takkat-nebuk) wrote :

#21 thank you for reporting. We'll have a look at this (should be an easy fix).

Revision history for this message
BubbaJ (azstuenthome) wrote : Re: [Bug 930538] Re: Unable to maximize window after selecting "run minimized" option

Takkat, while you are looking at #21's about the maximized window, would it be possible to look at an option to "minimize" the dialog back to the notification area only? I can't remember if we discussed this before or not.

For me after showing the settings window and minimizing, the application icon is displayed in the launcher as a running application. I haven't figured out a way to get rid of the launcher icon without stopping and restarting (as minimized). I would prefer that it not display in the launcher as once it is set there should be little need to open it again.

-----Original Message-----
From: Takkat <email address hidden>
Sender: <email address hidden>
Date: Sun, 08 Jul 2012 09:37:34
To: <email address hidden>
Reply-To: Bug 930538 <email address hidden>
Subject: [Bug 930538] Re: Unable to maximize window after selecting "run
 minimized" option

#21 thank you for reporting. We'll have a look at this (should be an
easy fix).

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/930538

Title:
  Unable to maximize window after selecting "run minimized" option

Status in bt-autoconnect:
  Fix Released

Bug description:
  I have been looking for a tool to automatically connect my BT headset
  and change the input/output to the headset automatically after
  connected. I found your application after doing some searching. I am
  able to get the application to auto connect to my headset after it is
  turned on. The application also routes the audio input/output
  correctly to the headset after connecting.

  I have set the application to start at startup. I also checked the box
  to "run minimized at startup". The problem I am having now is that I
  am not able to maximize the application window. Clicking on the icon
  in the Ubuntu launcher or clicking on the "Show window" option from
  the drop down in the notification area do not display the dialog box.
  Even if I quit the application and restart, or reboot the system and
  restart does not work.

  The laptop is used by three different family members. I use fast user
  switching in Ubuntu to switch between accounts. Not sure if this is an
  issue for the application or not, but each user may want to have the
  app running to allow auto connect to the BT headset. Let me know if
  you need any further detail. Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/bt-autoconnect/+bug/930538/+subscriptions

Revision history for this message
Takkat (takkat-nebuk) wrote :

#21 #24 fixed in release 0.2.6

We had the window appear on error but then it won't minimize any more. Now only in case there is no Bluetooth adapter detected the window will appear to enable `Retry' even when starting minimized on autostart.

There also should now be no icon in the launcher when run minimized.

When in a reconnect-loop we may not be able to show preferences from the application indicator because of bug #1020742 until a device was detected. Not much we can do about this atm.

Revision history for this message
Takkat (takkat-nebuk) wrote :

Wrong bug URL in #25. Its bug #991305 that is related to the GUI freezes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.