! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Compile with xfce 4.7 headers
Status:
RESOLVED: FIXED
Product:
Xfce4-cpugraph-plugin
Component:
General

Comments

Description Mike Massonnet editbugs 2010-05-29 16:51:00 CEST
Created attachment 3000 
cpugraph-require-libxfcegui4.patch

libxfce4panel 4.7 doesn't include the libxfcegui4 header file for you, which is the right thing to do, but this requires you to include it yourself.

Patch attached.

You can also choose to replace the only call to xfce_exec to gtk_message_dialog.
Comment 1 Florian Rivoal editbugs 2010-05-31 12:52:07 CEST
I like that xfce_exec call as it is, so I'll be using your patch. Thanks.

But I am not too sure, what does a gtk_message_dialog has to do with this?
Comment 2 Florian Rivoal editbugs 2010-05-31 13:00:46 CEST
I don't have libxfce4panel 4.7 installed locally, so I can't check by myself, but besides the changes in the makefile, is the addition of "#include <libxfcegui4/libxfcegui4.h>" to cpu.c really necessary?

It already is in cpu.h, which is included by cpu.c. That sounds like it should be enough, no? I am missing something?
Comment 3 Mike Massonnet editbugs 2010-05-31 13:23:39 CEST
(In reply to comment #1)
> I like that xfce_exec call as it is, so I'll be using your patch. Thanks.
> 
> But I am not too sure, what does a gtk_message_dialog has to do with this?

xfce_exec, riiight :) I thought about xfce_err to display an error message. Nevermind my suggestion for GtkMessageDialog. Well you can safely use g_spawn_command_line_async (or gdk_spawn_command_line_on_screen).

(In reply to comment #2)
> I don't have libxfce4panel 4.7 installed locally, so I can't check by myself,
> but besides the changes in the makefile, is the addition of "#include
> <libxfcegui4/libxfcegui4.h>" to cpu.c really necessary?
> 
> It already is in cpu.h, which is included by cpu.c. That sounds like it should
> be enough, no? I am missing something?

I didn't notice, so yes indeed, there is no need. However there is a simple rule for including header files inside .h files, if the .h file uses GtkSomething include gtk.h for a static variable or a function's argument, if it uses gchar/g... include glib.h, etc. In this case the gui4 header is needed for xfce_exec() which is called only in the cpu.c file. Right now other files including cpu.h will have access to gui4 functions, which is most probably not the expected behavior.
Comment 4 Florian Rivoal editbugs 2010-05-31 15:00:57 CEST
Fixed in git. Please try it out, as I don't have a 4.7 environment set up.

Bug #6479

Reported by:
Mike Massonnet
Reported on: 2010-05-29
Last modified on: 2010-10-03

People

Assignee:
Florian Rivoal
CC List:
0 users

Version

Attachments

cpugraph-require-libxfcegui4.patch (1.21 KB, patch)
2010-05-29 16:51 CEST , Mike Massonnet
no flags

Additional information