Let etip-compiler be silent.

Removed Crash handler code from evoke. ecrasher is for that.
Add some transparency to desktop icons when they are moved.
This commit is contained in:
Sanel Zukan 2008-01-15 14:42:44 +00:00
parent fb93a9f18f
commit 1fe32fef71
8 changed files with 17 additions and 216 deletions

View File

@ -487,8 +487,18 @@ void MovableIcon::show(void) {
#ifdef USE_SHAPE
if(icon->icon_image()) {
mask = create_mask(icon->icon_image());
if(mask)
if(mask) {
XShapeCombineMask(fl_display, fl_xid(this), ShapeBounding, 0, 0, mask, ShapeSet);
/*
* now set transparency; composite manager should handle the rest (if running)
* TODO: should this be declared as part of the class ?
*/
Atom opacity_atom = XInternAtom(fl_display, "_NET_WM_WINDOW_OPACITY", False);
unsigned int opacity = 0xc0000000;
XChangeProperty(fl_display, fl_xid(this), opacity_atom, XA_CARDINAL, 32, PropModeReplace,
(unsigned char*)&opacity, 1L);
}
}
#endif
}

View File

@ -375,8 +375,8 @@ bool Wallpaper::set(const char* path) {
Fl_Image* i = Fl_Shared_Image::get(path);
if(!i)
return false;
image(i);
image(i);
set_rootpmap();
return true;

View File

@ -192,6 +192,7 @@ Desktop::Desktop() : DESKTOP_WINDOW(0, 0, 100, 100, "") {
DESKTOP_WINDOW::init();
settings_uid(EICONMAN_UID);
settings_callback(settings_changed_cb);
//DESKTOP_WINDOW::single_buffer(true);
#endif
selbox = new SelectionOverlay;
@ -966,6 +967,8 @@ void Desktop::dir_watch(const char* dir, const char* changed, int flags) {
}
}
EDEBUG(ESTRLOC ": event on trash dir %s\n", dir);
return;
}

View File

@ -34,7 +34,7 @@ rule FortuneCompile
actions FortuneCompile1
{
$(TOP)/etip/etip-compiler "$(>)" "$(<)"
$(TOP)/etip/etip-compiler -s "$(>)" "$(<)"
}
FortuneCompile tips/ede.dat : tips/ede ;

View File

@ -1,157 +0,0 @@
/*
* $Id$
*
* Evoke, head honcho of everything
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2007 EDE Authors.
*
* This program is licensed under terms of the
* GNU General Public License version 2 or newer.
* See COPYING for details.
*/
#include "icons/core.xpm"
#include "Crash.h"
#include "Spawn.h"
#include <FL/Fl.h>
#include <FL/Fl_Pixmap.h>
#include <edelib/Nls.h>
#include <edelib/File.h>
#include <edelib/Directory.h>
#define DIALOG_W 380
#define DIALOG_H 130
#define DIALOG_W_EXPANDED 380
#define DIALOG_H_EXPANDED 340
void show_details_cb(Fl_Widget*, void* cd) {
CrashDialog* c = (CrashDialog*)cd;
c->show_details();
}
void close_cb(Fl_Widget*, void* cd) {
CrashDialog* c = (CrashDialog*)cd;
c->hide();
}
void dummy_timeout(void*) { }
CrashDialog::CrashDialog() : Fl_Window(DIALOG_W, DIALOG_H, _("World is going down...")) {
trace_loaded = 0;
begin();
pix = new Fl_Pixmap(core_xpm);
icon_box = new Fl_Box(10, 10, 70, 75);
icon_box->image(pix);
txt_box = new Fl_Box(85, 10, 285, 75);
txt_box->label(_("Program just crashed !!!\n\nYou can inspect details about this crash by clicking on 'Show backtrace' below"));
txt_box->align(FL_ALIGN_WRAP | FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
close = new Fl_Button(280, 95, 90, 25, _("&Close"));
close->callback(close_cb, this);
details = new Fl_Button(10, 95, 265, 25, _("@> Show backtrace"));
details->box(FL_FLAT_BOX);
details->align(FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
details->callback(show_details_cb, this);
// widgets for expanded dialog
trace_log = new Fl_Text_Display(10, 130, 360, 165);
trace_buff = new Fl_Text_Buffer();
trace_log->buffer(trace_buff);
trace_log->hide();
save_as = new Fl_Button(280, 305, 90, 25, _("&Save As..."));
save_as->hide();
copy = new Fl_Button(185, 305, 90, 25, _("&Copy"));
copy->hide();
end();
}
CrashDialog::~CrashDialog() {
// looks like fltk does not clean image() assigned data
delete pix;
}
void CrashDialog::show_details(void) {
if(trace_log->visible()) {
trace_log->hide();
save_as->hide();
copy->hide();
details->label(_("@> Show backtrace"));
size(DIALOG_W, DIALOG_H);
} else {
trace_log->show();
save_as->show();
copy->show();
details->label(_("@< Hide backtrace"));
size(DIALOG_W_EXPANDED, DIALOG_H_EXPANDED);
if(!trace_loaded) {
trace_buff->remove(0, trace_buff->length());
edelib::String gdb_path = edelib::file_path("gdb");
if(gdb_path.empty()) {
trace_buff->append(_("Unable to load gdb. Is it installed ?"));
trace_loaded = 0;
return;
}
// check if we can write in /tmp; if not, try with $HOME
edelib::String dir = "/tmp";
if(!edelib::dir_writeable(dir.c_str())) {
dir = edelib::dir_home();
if(!edelib::dir_writeable(dir.c_str())) {
trace_buff->append(_("Don't have permissions to write either to /tmp or $HOME"));
trace_loaded = 0;
return;
}
}
edelib::String gdb_output, gdb_script;
gdb_output = gdb_script = dir;
gdb_output += "/.gdb_output";
gdb_script += "/.gdb_script";
const char* core_file = "core";
if(spawn_backtrace(gdb_path.c_str(), cmd.c_str(), core_file, gdb_output.c_str(), gdb_script.c_str()) == -1) {
trace_buff->append(_("Unable to properly execute gdb"));
trace_loaded = 0;
return;
}
if(!edelib::file_exists(gdb_output.c_str())) {
trace_buff->append(_("Strange, can't find gdb output that I was just wrote to"));
trace_loaded = 0;
return;
}
trace_buff->appendfile(gdb_output.c_str());
edelib::file_remove(gdb_output.c_str());
edelib::file_remove(gdb_script.c_str());
edelib::file_remove(core_file);
trace_loaded = 1;
}
}
}
void CrashDialog::set_data(const char* command) {
cmd = command;
trace_loaded = 0;
}
void CrashDialog::run(void) {
if(!shown()) {
set_modal();
show();
}
while(shown())
Fl::wait();
}

View File

@ -1,50 +0,0 @@
/*
* $Id$
*
* Evoke, head honcho of everything
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2007 EDE Authors.
*
* This program is licensed under terms of the
* GNU General Public License version 2 or newer.
* See COPYING for details.
*/
#ifndef __CRASH_H__
#define __CRASH_H__
#include <FL/Fl_Window.h>
#include <FL/Fl_Box.h>
#include <FL/Fl_Button.h>
#include <FL/Fl_Pixmap.h>
#include <FL/Fl_Text_Display.h>
#include <FL/Fl_Text_Buffer.h>
#include <edelib/String.h>
class CrashDialog : public Fl_Window {
private:
Fl_Pixmap* pix;
Fl_Box* txt_box;
Fl_Box* icon_box;
Fl_Button* close;
Fl_Button* details;
Fl_Text_Display* trace_log;
Fl_Text_Buffer* trace_buff;
Fl_Button* save_as;
Fl_Button* copy;
edelib::String cmd;
bool trace_loaded;
public:
CrashDialog();
~CrashDialog();
void show_details(void);
void set_data(const char* command);
void run(void);
};
#endif

View File

@ -15,7 +15,6 @@
#include "EvokeService.h"
#include "Splash.h"
#include "Spawn.h"
#include "Crash.h"
#include "Autostart.h"
#include <edelib/File.h>
@ -617,9 +616,6 @@ void EvokeService::wake_up(int fd) {
if(ret) {
printf("%s crashed with core dump\n", pc.cmd.c_str());
CrashDialog cdialog;
cdialog.set_data(pc.cmd.c_str());
cdialog.run();
}
} else {
mutex.lock();

View File

@ -26,10 +26,9 @@ SOURCE = evoke.cpp
Splash.cpp
Log.cpp
Logout.cpp
Crash.cpp
Autostart.cpp ;
LinkAgainst evoke : -lXcomposite -lXdamage -lXfixes -lXrender -lao -lvorbis -lvorbisfile ;
LinkAgainst evoke : -lXcomposite -lXdamage -lXfixes -lXrender ;
#LinkAgainst evoke : -lpthread ;
EdeProgram evoke : $(SOURCE) ;