blueman-project / blueman

Blueman is a GTK+ Bluetooth Manager
GNU General Public License v3.0
1.27k stars 192 forks source link

Deprecated GTK+ / GLib properties #288

Closed cschramm closed 8 years ago

cschramm commented 9 years ago

We should take care of all those deprecation warnings. Deprecated properties include:

leigh123linux commented 9 years ago

Can you add PyGI Deprecated fixes

rough fixes from me (I'm not a coder :smiley: )

http://pastebin.com/raw.php?i=Cj6DT64D

and what appears to be gi changes

http://pastebin.com/raw.php?i=Bxg9zCct

infirit commented 9 years ago

@leigh123linux, your pastes are gone, can you put them in a gist perhaps?

I just took care of the gsettings one with 5ab15125dcfe5ebf5dbf578e50903816eb10c340

leigh123linux commented 9 years ago

@infirit

http://pkgs.fedoraproject.org/cgit/blueman.git/tree/fix_gi_import.patch

and

http://pkgs.fedoraproject.org/cgit/blueman.git/tree/PyGIDeprecationWarning.patch

infirit commented 9 years ago

@leigh123linux, thanks.

I pushed s couple of commits to take care of those. Let me know if folks run into issues :smile:

infirit commented 9 years ago

@cschramm, which Gtk+3 version is the taget? I ask because margin-left is deprecated in 3.12 and replaced with margin-start. But if I use the new property this means we drop support for earlier versions.

cschramm commented 9 years ago

Basically I'd say we stick with the deprecated one for now if the replacement is not available in older versions. But... I could not find margin-left in our code. Do you actually want to introduce it (as a replacement for some other deprecated property)?

infirit commented 9 years ago

I am moving/replacing the alignment/padding set by the GtkAlignment widget to the GtkBox widgets, see here for what I am talking about.

So yes I am introducing it to replace left-padding from the GtkAlignment and in the process figured out that it was also deprecated. I'll keep it for now but let me know if you want me to use the new margin-start.

infirit commented 9 years ago

The alignment properties and viewport resize-mode deprecations are sorted.

infirit commented 9 years ago

All but one left, GtkSettings:gtk-button-images.

There are still warnings but these are for the margin-left and margin-right properties discussed earlier.

cschramm commented 9 years ago

Great! :smiley:

That warning is triggered when calling set_image on a Gtk.Button. The strange thing is... There's no deprecation notice in the docs...

infirit commented 9 years ago

Indeed they hid this well, see https://github.com/GNOME/gtk/blob/master/gtk/gtksettings.c#L1313

However, we do not set it anywhere in blueman but I know desktops like MATE and Xfce do fiddle with GtkSettings. I'll poke around MATE to see if I can make the warning go away.

infirit commented 9 years ago

We do set it in mate-settings-daemon here. However un-setting make no difference to the warning while it does remove the button images for both Gtk versions :confused:..

infirit commented 9 years ago

Ok, this is what is what is going on. The GtkSetting is deprecated, and when we set the image on a button with text the image can be switched on or off via this setting. It seems this behaviour is deprecated, because reasons (insert your favourite Gtk3 rant). I can force the image on with self.b_more.props.always_show_image = True and the warning goes away. Which means the image is always shown which may or may not be what was originally intended for this button...

The question is, force to always show the image or let it be handled by GtkSettings and it probably will get forced eventually when the brilliant ui designers of gnome decide deprecation time is over...

leigh123linux commented 9 years ago

I get this warning from blueman git

(blueman-applet:2441): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
$ rpm -q blueman
blueman-2.1-0.1.git0a5defd.fc23.x86_64
cschramm commented 9 years ago

@leigh123linux How is that related to this change? Did you bisect it?

yars068 commented 9 years ago

I have current blueman-git-07afca4, that is about deprecation warnings: http://pastebin.com/nB5ntQH4 That is uder slackware-current with gtk+-3.16.6.

I could not find margin-left in our code

That is not in the code, but, for example, blueman-manager imports data/ui/manager-main.ui, that file contains the margin_left and margin_right properties.

infirit commented 9 years ago

Regarding the margin-* properties see above. In short, Glade (gui) does not support them and if we use them we drop compatibility with < Gtk+ 3.12. I suggest to wait for Glade to catch up before we look at these.

The images on buttons see this

The GSettings warning is fixed already.

cschramm commented 8 years ago

I think we can close this, as the current state is the best we can currently achieve. Objections?

infirit commented 8 years ago

We can do another round for 2.2 :smile:

Sent from my Android device with K-9 Mail. Please excuse my brevity.