Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new code

  • Loading branch information...
commit ecb4abbd03abd13d2c95df4cd2be0258bc0c7ca1 1 parent f4666e6
@antico authored
View
0  COPYING 100755 → 100644
File mode changed
View
0  README 100755 → 100644
File mode changed
View
0  antico.pro 100755 → 100644
File mode changed
View
7 install
@@ -3,6 +3,11 @@ green='\e[0;32m'
yellow='\e[0;33m'
white='\e[0;37m'
+if [[ $EUID -ne 0 ]]; then
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
if [ ! -e /usr/bin/antico ]; then
ln -s ${PWD}/antico /usr/bin/antico
fi
@@ -21,4 +26,4 @@ fi
echo -e "${white}***********************************************"
echo -e " ${green}Antico ${yellow}successfully installed${white}"
-echo -e "***********************************************"
+echo -e "***********************************************"
View
32 src/antico.cpp
@@ -27,8 +27,6 @@ Antico::Antico(int &argc, char **argv) : QApplication(argc, argv)
set_settings();
// send ClientMessage to root for supported hints
send_supported_hints();
- // run application from startup list
- run_app_at_startup();
// check if server supports nonrectangular windows
int err;
servershapes = XShapeQueryExtension(QX11Info::display(), &ShapeEventBase, &err);
@@ -430,7 +428,6 @@ bool Antico::x11EventFilter(XEvent *event)
if (pev->atom == wm_transient_for)
{
qDebug() << "---> wm_transient_for";
- XGrabServer(QX11Info::display());
}
if (pev->atom == _net_wm_user_time)
{
@@ -581,8 +578,8 @@ void Antico::create_frame(Window c_win, Dockbar *dock, Desk *desk) // create new
return;
else
{
- check_window_type(c_win);
check_wm_transient_for(c_win);
+ check_window_type(c_win);
}
/////// MAP THE NEW CLIENT ////////
@@ -646,28 +643,23 @@ void Antico::check_window_type(Window c_win) // chech the window type before map
frame_type << "Normal";
qDebug() << "Window type: NORMAL TYPE";
}
- else if (win_type[i] == _net_wm_window_type_dialog)
+ if (win_type[i] == _net_wm_window_type_dialog)
{
frame_type << "Dialog";
qDebug() << "Window type: DIALOG TYPE";
}
- else if (win_type[i] == _net_wm_window_type_splash)
+ if (win_type[i] == _net_wm_window_type_splash)
{
frame_type << "Splash";
qDebug() << "Window type: SPLASH TYPE";
}
- else if (win_type[i] == _net_wm_window_type_desktop)
+ if (win_type[i] == _net_wm_window_type_desktop)
{
frame_type << "Desktop";
qDebug() << "Window type: DESKTOP TYPE";
}
- else
- {
- /// DEFAULT WINDOW TYPE ///
- frame_type << "Normal";
- qDebug() << "Window type: Normal";
- }
}
+ return;
}
/// IF PROPERTY NOT SET ///
frame_type << "Normal";
@@ -679,6 +671,7 @@ void Antico::check_window_type(Window c_win) // chech the window type before map
void Antico::check_wm_transient_for(Window c_win)
{
Atom type_ret = None;
+ Window prop_window_return;
unsigned char *data = 0;
int format = 0;
unsigned long n = 0;
@@ -687,10 +680,15 @@ void Antico::check_wm_transient_for(Window c_win)
if (XGetWindowProperty(QX11Info::display(), c_win, wm_transient_for, 0, 100, False,
AnyPropertyType, &type_ret, &format, &n, &extra, (unsigned char **)&data) == Success && data)
{
- frame_type << "Splash";
- qDebug() << "Window type: WM_TRANSIENT_FOR. SET AS SPLASH";
- XFree(data);
+ qDebug() << "Window type: WM_TRANSIENT_FOR. Set as DIALOG";
+
+ if (XGetTransientForHint(QX11Info::display(), c_win, &prop_window_return))
+ {
+ qDebug() << "Window return:" << prop_window_return;
+ frame_type << "Dialog";
+ }
}
+ XFree(data);
}
void Antico::print_window_prop(Window c_win) // print the window properties
@@ -919,6 +917,8 @@ void Antico::create_gui()
dsk = new Desk(this);
// create dockbar
dock = new Dockbar(this);
+ // run application from startup list
+ run_app_at_startup();
}
Filedialog * Antico::get_file_dialog()
View
13 src/filedialog.cpp
@@ -118,6 +118,7 @@ void Filedialog::init()
dir_model = new QDirModel(this);
dir_model->setSupportedDragActions(Qt::LinkAction);
+ dir_model->setReadOnly(false);
completer = new QCompleter(this);
completer->setModel(dir_model);
@@ -264,7 +265,7 @@ void Filedialog::del_file()
if (QProcess::startDetached("/bin/mv", rem_info_args)) // remove the directory
{
- dir_model->refresh(); // update the View
+ update_view(); // update the View
Msgbox msg;
msg.set_header(tr("INFORMATION"));
@@ -288,7 +289,7 @@ void Filedialog::del_file()
if (QProcess::startDetached("/bin/mv", rem_info_args)) // remove the file
{
- dir_model->refresh(); // update the View
+ update_view(); // update the View
Msgbox msg;
msg.set_header(tr("INFORMATION"));
@@ -355,7 +356,7 @@ void Filedialog::paste_file()
if (QProcess::startDetached(command))
{
- dir_model->refresh(); // update the View
+ update_view(); // update the View
Msgbox msg;
msg.set_header(tr("INFORMATION"));
@@ -529,6 +530,12 @@ void Filedialog::contextMenuEvent(QContextMenuEvent *event)
event->ignore();
}
+void Filedialog::update_view()
+{
+ tree_view->setRootIndex(dir_model->index(line_path->text()));
+ dir_model->refresh(dir_model->index(line_path->text()));
+}
+
void Filedialog::update_style()
{
read_settings();
View
1  src/filedialog.h
@@ -58,6 +58,7 @@ public slots:
void path_completer();
void upper_dir();
void update_list(const QModelIndex &);
+ void update_view();
void contextMenuEvent(QContextMenuEvent *);
void change_path(QListWidgetItem *, QListWidgetItem *);
void set_icon_mode();
View
4 src/frame.cpp
@@ -99,7 +99,7 @@ void Frame::init()
XSetWindowBorderWidth(QX11Info::display(), c_win, 0); //client
XSetWindowBorderWidth(QX11Info::display(), winId(), 0); //frame
- // ***THE MOST IMPORTANT FUNCTION*** // reparent client with frame
+ // ***THE MOST IMPORTANT FUNCTION*** // reparent client with frame
XReparentWindow(QX11Info::display(), c_win, winId(), lateral_bdr_width, top_bdr_height);
qDebug() << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
qDebug() << "Reparent Client:" << c_win << "with Frame:" << winId() << "- Name:" << cl_name();
@@ -108,7 +108,7 @@ void Frame::init()
XAddToSaveSet(QX11Info::display(), c_win);
// move and resize client
XMoveResizeWindow(QX11Info::display(), c_win, lateral_bdr_width, top_bdr_height+3, client_w, client_h);
-
+
//if the frame is too large, maximize it
if (frame_w >= QApplication::desktop()->width()-20 || frame_h >= QApplication::desktop()->height()-40)
{
View
25 uninstall
@@ -3,22 +3,27 @@ green='\e[0;32m'
yellow='\e[0;33m'
white='\e[0;37m'
+if [[ $EUID -ne 0 ]]; then
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
if [ -f /usr/bin/antico ]; then
- rm /usr/bin/antico
+rm /usr/bin/antico
fi
-
+
if [ -f /etc/X11/sessions/antico-gdm.desktop ]; then
- rm /etc/X11/sessions/antico-gdm.desktop
+rm /etc/X11/sessions/antico-gdm.desktop
fi
-
+
if [ -f /usr/share/xsessions/antico-kdm.desktop ]; then
- rm /usr/share/xsessions/antico-kdm.desktop
+rm /usr/share/xsessions/antico-kdm.desktop
fi
-
+
if [ -f /usr/share/apps/kdm/sessions/antico-kdm.desktop ]; then
- rm /usr/share/apps/kdm/sessions/antico-kdm.desktop
+rm /usr/share/apps/kdm/sessions/antico-kdm.desktop
fi
-
+
echo -e "${white}***********************************************"
-echo -e " ${green}Antico ${yellow}successfully uninstalled${white}"
-echo -e "***********************************************"
+echo -e " ${green}Antico ${yellow}successfully uninstalled${white}"
+echo -e "***********************************************"
Please sign in to comment.
Something went wrong with that request. Please try again.